Skip to content

Commit 6dd73e5

Browse files
committed
Fix join logic: correct field incorrectly identified as a foreign key.
1 parent 59a2ac3 commit 6dd73e5

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

django_mongodb/features.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
8686
# https://github.com/mongodb-labs/django-mongodb/issues/161
8787
"queries.tests.RelatedLookupTypeTests.test_values_queryset_lookup",
8888
"queries.tests.ValuesSubqueryTests.test_values_in_subquery",
89-
# Wrong results for distinct() queries.
90-
"admin_filters.tests.ListFiltersTests.test_emptylistfieldfilter_genericrelation",
9189
}
9290
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
9391
_django_test_expected_failures_bitwise = {

django_mongodb/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def join(self, compiler, connection):
154154
if isinstance(hand_side_value, Col):
155155
# If the column is not part of the joined table, add it to
156156
# lhs_fields.
157-
if hand_side_value.alias != self.table_name:
157+
if hand_side_value.alias != self.table_alias:
158158
pos = len(lhs_fields)
159159
lhs_fields.append(expr.lhs.as_mql(compiler, connection))
160160
else:

0 commit comments

Comments
 (0)