From b95c49c954e3b75678bb258e9fb2ec30d0d960bb Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 12 Feb 2018 14:00:29 -0500 Subject: Fixed #29125 -- Made Q.deconstruct() deterministic with multiple keyword arguments. --- django/db/models/query_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py index 1dcf22fda8..e34963b65c 100644 --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -58,7 +58,7 @@ class Q(tree.Node): def __init__(self, *args, **kwargs): connector = kwargs.pop('_connector', None) negated = kwargs.pop('_negated', False) - super().__init__(children=list(args) + list(kwargs.items()), connector=connector, negated=negated) + super().__init__(children=list(args) + sorted(kwargs.items()), connector=connector, negated=negated) def _combine(self, other, conn): if not isinstance(other, Q): -- cgit v1.3