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:
parent
b121b58a86
commit
47d8d67c3d
7 changed files with 22 additions and 12 deletions
|
|
@ -112,8 +112,9 @@ class EntityManager(Manager):
|
|||
def find(self, data, user, item=None):
|
||||
#join query with operator
|
||||
qs = self.get_query_set()
|
||||
conditions = parseConditions(data['query'].get('conditions', []),
|
||||
data['query'].get('operator', '&'),
|
||||
query = data.get('query', {})
|
||||
conditions = parseConditions(query.get('conditions', []),
|
||||
query.get('operator', '&'),
|
||||
user, item)
|
||||
if conditions:
|
||||
qs = qs.filter(conditions)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue