Commit 8ffbcd00 authored by Michal Čihař's avatar Michal Čihař

We need to catch index error here as well

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent b46e8170
...@@ -1129,7 +1129,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin): ...@@ -1129,7 +1129,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
# Grab database unit # Grab database unit
try: try:
dbunit = self.unit_set.filter(checksum=checksum)[0] dbunit = self.unit_set.filter(checksum=checksum)[0]
except Unit.DoesNotExist: except (Unit.DoesNotExist, IndexError):
continue continue
# Indicate something new # Indicate something new
......
...@@ -39,7 +39,7 @@ def get_source(request, project, subproject): ...@@ -39,7 +39,7 @@ def get_source(request, project, subproject):
obj = get_subproject(request, project, subproject) obj = get_subproject(request, project, subproject)
try: try:
return obj, obj.translation_set.all()[0] return obj, obj.translation_set.all()[0]
except Translation.DoesNotExist: except (Translation.DoesNotExist, IndexError):
raise Http404('No translation exists in this component.') raise Http404('No translation exists in this component.')
......
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