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

Do not unconditionally return all checks

parent c0100486
......@@ -1124,7 +1124,9 @@ class Translation(models.Model):
By default for all checks or check type can be specified.
'''
return self.failing_checks
if check == 'allchecks':
return self.failing_checks
return self.unit_set.count_type(check, self)
def get_failing_checks_percent(self, check='allchecks'):
'''
......@@ -1132,7 +1134,7 @@ class Translation(models.Model):
'''
if self.total == 0:
return 0
return round(self.failing_checks * 100.0 / self.total, 1)
return round(self.get_failing_checks(check) * 100.0 / self.total, 1)
def invalidate_cache(self, cache_type=None):
'''
......
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