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

Simplify code by checking resulting match

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 4228225e
...@@ -967,14 +967,10 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin): ...@@ -967,14 +967,10 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
''' '''
Parses language code from path. Parses language code from path.
''' '''
# No * in mask?
if '*' not in self.filemask:
return ''
# Parse filename # Parse filename
matches = self.filemask_re.match(path) matches = self.filemask_re.match(path)
if not matches: if not matches or not matches.lastindex:
# Assume English language for template # Assume English language for template
if path == self.template: if path == self.template:
return 'en' return 'en'
......
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