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

Simplify defaults handling

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent f5353579
......@@ -189,15 +189,13 @@ class UnitManager(models.Manager):
"""
High level wrapper for searching.
"""
base = self.all()
if params['type'] != 'all':
base = self.filter_type(
params['type'],
translation,
params['ignored']
)
else:
base = self.all()
if not params['q']:
return base
......@@ -205,9 +203,8 @@ class UnitManager(models.Manager):
if params['search'] in ('exact', 'substring'):
queries = []
if params['search'] == 'exact':
modifier = ''
else:
modifier = ''
if params['search'] != 'exact':
modifier = '__icontains'
for param in SEARCH_FILTERS:
......
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