Commit c5f41982 authored by Michal Čihař's avatar Michal Čihař

Improve skipping encoding part from language code

We can not blidly ignore anything after ., we have to do at least basic
check that it looks like an encoding.

Issue #27
Issue #760
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 32870112
......@@ -966,7 +966,9 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
else:
code = path[len(parts[0]):-len(parts[1])].split('/')[0]
# Remove possible encoding part
return code.split('.')[0]
if '.' in code and ('.utf' in code.lower() or '.iso' in code.lower()):
return code.split('.')[0]
return code
def sync_git_repo(self, validate=False):
'''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment