mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Fixed #29166 -- Fixed crash in When() expression with a list argument.
Thanks Matthew Pava for the report and Tim Graham and Carlton Gibson for
reviews.
Regression in 19b2dfd1bf
.
This commit is contained in:
parent
3fb718f17d
commit
54f80430be
3 changed files with 27 additions and 1 deletions
|
@ -369,7 +369,12 @@ class BaseExpression:
|
|||
|
||||
def __hash__(self):
|
||||
path, args, kwargs = self.deconstruct()
|
||||
return hash((path,) + args + tuple(kwargs.items()))
|
||||
kwargs = kwargs.copy()
|
||||
output_field = type(kwargs.pop('output_field', None))
|
||||
return hash((path, output_field) + args + tuple([
|
||||
(key, tuple(value)) if isinstance(value, list) else (key, value)
|
||||
for key, value in kwargs.items()
|
||||
]))
|
||||
|
||||
|
||||
class Expression(BaseExpression, Combinable):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue