summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/fields/jsonb.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-08-14 15:25:35 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-08-14 15:37:01 +0200
commit968b9af9b7f7e49af17fc82de5a2de9a91b86e44 (patch)
treee4eb30ff145130808f4f0e709d6b38d43624b258 /django/contrib/postgres/fields/jsonb.py
parent46c2856543f97f41f520426483413eb8b64c878b (diff)
[2.1.x] Fixed #30672 -- Fixed crash of JSONField/HStoreField key transforms on expressions with params.
Regression in 4f5b58f5cd3c57fee9972ab074f8dc6895d8f387. Thanks Florian Apolloner for the report and helping with tests. Backport of 1f8382d34d54061eddc41df6994e20ee38c60907 from master.
Diffstat (limited to 'django/contrib/postgres/fields/jsonb.py')
-rw-r--r--django/contrib/postgres/fields/jsonb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/postgres/fields/jsonb.py b/django/contrib/postgres/fields/jsonb.py
index be98ff2d48..be93b11d9f 100644
--- a/django/contrib/postgres/fields/jsonb.py
+++ b/django/contrib/postgres/fields/jsonb.py
@@ -112,7 +112,7 @@ class KeyTransform(Transform):
lookup = int(self.key_name)
except ValueError:
lookup = self.key_name
- return '(%s %s %%s)' % (lhs, self.operator), [lookup] + params
+ return '(%s %s %%s)' % (lhs, self.operator), params + [lookup]
class KeyTextTransform(KeyTransform):