findAnnotations(): make 'findvalue' the default key
Annotations have no 'name' field, so findAnnotations({query: {conditions: [{value: 'foo'}]}}) would previously raise an exception.
This commit is contained in:
parent
284caf03c3
commit
8d1b4de337
1 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ def parseCondition(condition, user):
|
||||||
operator: "!="
|
operator: "!="
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
k = condition.get('key', 'name')
|
k = condition.get('key')
|
||||||
k = {
|
k = {
|
||||||
'user': 'user__username',
|
'user': 'user__username',
|
||||||
'place': 'places__id',
|
'place': 'places__id',
|
||||||
|
@ -32,7 +32,7 @@ def parseCondition(condition, user):
|
||||||
'value': 'findvalue',
|
'value': 'findvalue',
|
||||||
}.get(k, k)
|
}.get(k, k)
|
||||||
if not k:
|
if not k:
|
||||||
k = 'name'
|
k = 'findvalue'
|
||||||
v = condition['value']
|
v = condition['value']
|
||||||
op = condition.get('operator')
|
op = condition.get('operator')
|
||||||
if not op:
|
if not op:
|
||||||
|
|
Loading…
Reference in a new issue