Allow 'query' to be omitted from find*() (fixes #2883)

I hit this in findDocuments() so thought I'd fix them all.
This commit is contained in:
Will Thompson 2016-02-15 14:21:36 +00:00
commit 47d8d67c3d
7 changed files with 22 additions and 12 deletions

View file

@ -80,7 +80,10 @@ def findLists(request, data):
return x['key'] == 'status' and \
x['value'] == 'featured' and \
x['operator'] in ('=', '==')
is_featured = len(filter(is_featured_condition, data['query'].get('conditions', []))) > 0
is_featured = any(
is_featured_condition(x)
for x in data.get('query', {}).get('conditions', [])
)
if is_section_request:
qs = query['qs']