Commit 37a0a6fc authored by Michal Čihař's avatar Michal Čihař

Correct place to define initial value for created

See issue #471
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 40b0dc41
......@@ -47,12 +47,12 @@ class UnitManager(models.Manager):
src = unit.get_source()
ctx = unit.get_context()
checksum = unit.get_checksum()
created = False
# Try getting existing unit
dbunit = None
try:
dbunit = translation.unit_set.get(checksum=checksum)
created = False
except Unit.MultipleObjectsReturned:
# Some inconsistency (possibly race condition), try to recover
dbunit = translation.unit_set.filter(checksum=checksum).delete()
......
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