gentoo/dev-python/django-polymorphic/files/django-polymorphic-4.0.0-test.patch
Michał Górny 3a27a80ccb
dev-python/django-polymorphic: Bump to 4.0.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2025-03-18 15:06:05 +01:00

24 lines
947 B
Diff

From ecb85b3539c71e376eb0a111e98b5b374d5c9532 Mon Sep 17 00:00:00 2001
From: Jonathan he <jonathan.he@oracle.com>
Date: Wed, 5 Feb 2025 16:02:04 -0500
Subject: [PATCH] PolymorphicQuerySet: Prevent NoneType error in test___lookup
---
polymorphic/query.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/polymorphic/query.py b/polymorphic/query.py
index 8e93281..ba67529 100644
--- a/polymorphic/query.py
+++ b/polymorphic/query.py
@@ -277,7 +277,8 @@ class PolymorphicQuerySet(QuerySet):
tree_node_test___lookup(self.model, a)
elif hasattr(a, "get_source_expressions"):
for source_expression in a.get_source_expressions():
- test___lookup(source_expression)
+ if source_expression is not None:
+ test___lookup(source_expression)
else:
assert "___" not in a.name, ___lookup_assert_msg