From 8d1b4de337ee1e5c5f88603fe71cf039b1ae9c7e Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 4 Apr 2016 14:22:20 +0100 Subject: [PATCH] findAnnotations(): make 'findvalue' the default key Annotations have no 'name' field, so findAnnotations({query: {conditions: [{value: 'foo'}]}}) would previously raise an exception. --- pandora/annotation/managers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/annotation/managers.py b/pandora/annotation/managers.py index 65c16bc6..de050e10 100644 --- a/pandora/annotation/managers.py +++ b/pandora/annotation/managers.py @@ -20,7 +20,7 @@ def parseCondition(condition, user): operator: "!=" } ''' - k = condition.get('key', 'name') + k = condition.get('key') k = { 'user': 'user__username', 'place': 'places__id', @@ -32,7 +32,7 @@ def parseCondition(condition, user): 'value': 'findvalue', }.get(k, k) if not k: - k = 'name' + k = 'findvalue' v = condition['value'] op = condition.get('operator') if not op: