Commit 2f09acfc authored by Michal Čihař's avatar Michal Čihař

Update stats on unit content change

Even when there was no change on checks, changed content could lead to
different state of checks than it was before in case there are more
units with same contentsum within the project.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent f7f37b13
......@@ -667,7 +667,7 @@ class Unit(models.Model):
# Update checks if content or fuzzy flag has changed
if not same_content or not same_state:
self.check(same_state, force_insert)
self.check(same_state, same_content, force_insert)
# Update fulltext index if content has changed or this is a new unit
if force_insert or not same_content:
......@@ -847,7 +847,7 @@ class Unit(models.Model):
return (checks_to_run, cleanup_checks)
def check(self, same_state=True, is_new=False):
def check(self, same_state=True, same_content=True, is_new=False):
'''
Updates checks for this unit.
'''
......@@ -912,7 +912,7 @@ class Unit(models.Model):
)
# Update failing checks flag
if was_change or is_new:
if was_change or is_new or not same_content:
self.update_has_failing_check(was_change)
def update_has_failing_check(self, recurse=False):
......
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