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

Simplify getting unit for checksum

parent f0f51869
...@@ -1158,10 +1158,10 @@ class Translation(models.Model, URLMixin, PercentMixin): ...@@ -1158,10 +1158,10 @@ class Translation(models.Model, URLMixin, PercentMixin):
checksum = unit.get_checksum() checksum = unit.get_checksum()
# Grab database unit # Grab database unit
dbunit = self.unit_set.filter(checksum=checksum) try:
if not dbunit.exists(): dbunit = self.unit_set.filter(checksum=checksum)[0]
except Unit.DoesNotExist:
continue continue
dbunit = dbunit[0]
# Indicate something new # Indicate something new
ret = True ret = True
......
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