From a6c79f4987c020cc9e96d4c5fc47730cd1031b4c Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Mon, 8 Feb 2021 11:48:06 +0000 Subject: [PATCH] Removed unused with_filtered_relation argument from .equals() Unused since bbf141bcdc31f1324048af9233583a523ac54c94. --- django/db/models/sql/datastructures.py | 7 +++---- django/db/models/sql/query.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py index c9598b3bd4..85278cd8d3 100644 --- a/django/db/models/sql/datastructures.py +++ b/django/db/models/sql/datastructures.py @@ -132,9 +132,8 @@ class Join: def __hash__(self): return hash(self.identity) - def equals(self, other, with_filtered_relation): - if with_filtered_relation: - return self == other + def equals(self, other): + # Ignore filtered_relation in equality check. return self.identity[:-1] == other.identity[:-1] def demote(self): @@ -183,5 +182,5 @@ class BaseTable: def __hash__(self): return hash(self.identity) - def equals(self, other, with_filtered_relation): + def equals(self, other): return self.identity == other.identity diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index b505af4efa..eb732f1c6c 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -967,7 +967,7 @@ class Query(BaseExpression): if reuse_with_filtered_relation and reuse: reuse_aliases = [ a for a, j in self.alias_map.items() - if a in reuse and j.equals(join, with_filtered_relation=False) + if a in reuse and j.equals(join) ] else: reuse_aliases = [