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

Support for filtering by any check

parent 2a5ed8f9
......@@ -145,18 +145,19 @@ class UnitManager(models.Manager):
project = sample.translation.subproject.project)
sugs = sugs.values_list('checksum', flat = True)
return self.filter(checksum__in = sugs)
elif rqtype in CHECKS:
elif rqtype in CHECKS or rqtype == 'allchecks':
try:
sample = self.all()[0]
except IndexError:
return self.none()
sugs = Check.objects.filter(
checks = Check.objects.filter(
language = sample.translation.language,
project = sample.translation.subproject.project,
check = rqtype,
ignore = False)
sugs = sugs.values_list('checksum', flat = True)
return self.filter(checksum__in = sugs, fuzzy = False, translated = True)
if rqtype != 'allchecks':
checks = checks.filter(check = rqtype)
checks = checks.values_list('checksum', flat = True)
return self.filter(checksum__in = checks, fuzzy = False, translated = True)
else:
return self.all()
......
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