summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-08-13 08:42:17 +0200
committerGitHub <noreply@github.com>2019-08-13 08:42:17 +0200
commitc19ad2da4b573431843e5cead77f4139e29c77a0 (patch)
treee8a311c6a7fb35c8130bf219c9f5ed203350fb84 /django
parentefa1908f662c19038a944129c81462485c4a9fe8 (diff)
Fixed #30704 -- Fixed crash of JSONField nested key and index transforms on expressions with params.
Thanks Florian Apolloner for the report and helping with tests.
Diffstat (limited to 'django')
-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..7d88579ecd 100644
--- a/django/contrib/postgres/fields/jsonb.py
+++ b/django/contrib/postgres/fields/jsonb.py
@@ -107,7 +107,7 @@ class KeyTransform(Transform):
previous = previous.lhs
lhs, params = compiler.compile(previous)
if len(key_transforms) > 1:
- return "(%s %s %%s)" % (lhs, self.nested_operator), [key_transforms] + params
+ return '(%s %s %%s)' % (lhs, self.nested_operator), params + [key_transforms]
try:
lookup = int(self.key_name)
except ValueError: