findAnnotations: don't lowercase ids (fixes #2916)

Without this fix, a condition like:

     {key: 'id', operator: '==', value: 'A/B'}

gets mapped to:

     public_id__exact=('A/B'.lower())

which is wrong.

I introduced this bug in b3df5b8. I didn't catch it because I was
mostly interested in the 'layer' key -- but layer names are
conventionally lowercase anyway so lowercasing them had no effect.
This commit is contained in:
Will Thompson 2016-04-29 10:56:00 +01:00
parent 34747c0fd7
commit 2812834ce3
No known key found for this signature in database
GPG key ID: 3422DC0D7AD482A7

View file

@ -92,7 +92,7 @@ def parseCondition(condition, user):
key = str(key) key = str(key)
if isinstance(v, unicode): if isinstance(v, unicode):
v = unicodedata.normalize('NFKD', v) v = unicodedata.normalize('NFKD', v)
if v not in case_sensitive_keys: if k not in case_sensitive_keys:
v = v.lower() v = v.lower()
if exclude: if exclude:
q = ~Q(**{key: v}) q = ~Q(**{key: v})