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

Use already calcualted check counts when available

parent c341e07a
...@@ -992,7 +992,7 @@ class Translation(models.Model, URLMixin): ...@@ -992,7 +992,7 @@ class Translation(models.Model, URLMixin):
for check in CHECKS: for check in CHECKS:
if not CHECKS[check].source: if not CHECKS[check].source:
continue continue
cnt = self.unit_set.count_type(check, self) cnt = self.get_failing_checks(check)
if cnt > 0: if cnt > 0:
desc = CHECKS[check].description + (' (%d)' % cnt) desc = CHECKS[check].description + (' (%d)' % cnt)
result.append((check, desc)) result.append((check, desc))
...@@ -1037,11 +1037,10 @@ class Translation(models.Model, URLMixin): ...@@ -1037,11 +1037,10 @@ class Translation(models.Model, URLMixin):
)) ))
# All checks # All checks
allchecks = self.unit_set.count_type('allchecks', self) if self.failing_checks > 0:
if allchecks > 0:
result.append(( result.append((
'allchecks', 'allchecks',
_('Strings with any failing checks (%d)') % allchecks _('Strings with any failing checks (%d)') % self.failing_checks
)) ))
# Process specific checks # Process specific checks
......
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