python313Packages.django-polymorphic: fix django 5.1 compat
This commit is contained in:
@@ -21,6 +21,11 @@ buildPythonPackage rec {
|
||||
hash = "sha256-cEV9gnc9gLpAVmYkzSaQwDbgXsklMTq71edndDJeP9E=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# https://github.com/jazzband/django-polymorphic/issues/616
|
||||
./django-5.1-compat.patch
|
||||
];
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
dependencies = [ django ];
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
From a2c48cedc45db52469b93b6fa7a5d50c6722586f Mon Sep 17 00:00:00 2001
|
||||
From: Ben Gosney <bengosney@googlemail.com>
|
||||
Date: Sun, 25 Aug 2024 14:49:33 +0100
|
||||
Subject: [PATCH] fix(query): handle None
|
||||
|
||||
---
|
||||
polymorphic/query.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/polymorphic/query.py b/polymorphic/query.py
|
||||
index 8e93281a..2d2df6c3 100644
|
||||
--- a/polymorphic/query.py
|
||||
+++ b/polymorphic/query.py
|
||||
@@ -278,7 +278,7 @@ def tree_node_test___lookup(my_model, node):
|
||||
elif hasattr(a, "get_source_expressions"):
|
||||
for source_expression in a.get_source_expressions():
|
||||
test___lookup(source_expression)
|
||||
- else:
|
||||
+ elif a is not None:
|
||||
assert "___" not in a.name, ___lookup_assert_msg
|
||||
|
||||
for a in args:
|
||||
Reference in New Issue
Block a user