Commit 0741911e authored by Michal Čihař's avatar Michal Čihař

Properly handle invalid links

parent 750dda13
......@@ -552,6 +552,7 @@ class SubProject(models.Model):
Then it checks them for validity.
'''
self.sync_git_repo(True)
try:
matches = self.get_mask_matches()
if len(matches) == 0:
raise ValidationError(_('The mask did not match any files!'))
......@@ -586,6 +587,9 @@ class SubProject(models.Model):
raise ValidationError(_('Format of translation template could not be recognized.'))
except Exception, e:
raise ValidationError(_('Failed to parse translation template.'))
except SubProject.DoesNotExist:
# Happens with invalid link
pass
def save(self, *args, **kwargs):
'''
......
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