Commit 7827e982 authored by Michal Čihař's avatar Michal Čihař

Simplify condition

parent aaa64549
......@@ -143,6 +143,7 @@ class UnitManager(models.Manager):
Basic filtering based on unit state or failed checks.
'''
import trans.models
import trans.checks
if rqtype == 'all':
return self.all()
elif rqtype == 'fuzzy':
......@@ -159,7 +160,7 @@ 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 [x[0] for x in trans.models.CHECK_CHOICES]:
elif rqtype in trans.checks.CHECKS:
try:
sample = self.all()[0]
except IndexError:
......
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