Commit 33b23d7c authored by Michal Čihař's avatar Michal Čihař

Keep consistency checks if there are more units with same source

parent c4d6a98d
......@@ -1879,8 +1879,16 @@ class Unit(models.Model):
Updates checks for this unit.
'''
if self.fuzzy:
# Keep consistency checks even for fuzzy strings
self.checks().exclude(check = 'inconsistent').delete()
# Keep consistency checks when there are more units like this
same_source = Unit.objects.filter(
translation__language = self.translation.language,
translation__subproject__project = self.translation.subproject.project,
checksum = self.checksum
).exclude(
id = unit.id
)
if not same_source.exists():
self.checks().delete()
return
src = self.get_source_plurals()
tgt = self.get_target_plurals()
......
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