Treat findEdits({}) like findEdits({query: {}}) (fixes #2820)
This commit is contained in:
parent
4c0652e683
commit
ab5a20d3a2
2 changed files with 5 additions and 3 deletions
|
@ -120,8 +120,9 @@ class EditManager(Manager):
|
||||||
|
|
||||||
#join query with operator
|
#join query with operator
|
||||||
qs = self.get_query_set()
|
qs = self.get_query_set()
|
||||||
conditions = parseConditions(data['query'].get('conditions', []),
|
query = data.get('query', {})
|
||||||
data['query'].get('operator', '&'),
|
conditions = parseConditions(query.get('conditions', []),
|
||||||
|
query.get('operator', '&'),
|
||||||
user)
|
user)
|
||||||
if conditions:
|
if conditions:
|
||||||
qs = qs.filter(conditions)
|
qs = qs.filter(conditions)
|
||||||
|
|
|
@ -396,7 +396,8 @@ def findEdits(request, data):
|
||||||
return x['key'] == 'status' and \
|
return x['key'] == 'status' and \
|
||||||
x['value'] == 'featured' and \
|
x['value'] == 'featured' and \
|
||||||
x['operator'] in ('=', '==')
|
x['operator'] in ('=', '==')
|
||||||
is_featured = len(filter(is_featured_condition, data['query'].get('conditions', []))) > 0
|
|
||||||
|
is_featured = len(filter(is_featured_condition, data.get('query', {}).get('conditions', []))) > 0
|
||||||
|
|
||||||
if is_section_request:
|
if is_section_request:
|
||||||
qs = query['qs']
|
qs = query['qs']
|
||||||
|
|
Loading…
Reference in a new issue