Commit ec541a0b authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents a1535e0a 8ffbcd00
...@@ -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