File: 0002-query-handle-None.patch

package info (click to toggle)
django-polymorphic 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 892 kB
  • sloc: python: 6,784; javascript: 263; makefile: 137
file content (23 lines) | stat: -rw-r--r-- 857 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Ben Gosney <bengosney@googlemail.com>
Date: Sun, 25 Aug 2024 14:49:33 +0100
Subject: fix(query): handle None

Origin: other, https://github.com/bengosney/django-polymorphic/commit/a2c48cedc45db52469b93b6fa7a5d50c6722586f
Last-Update: 2024-12-16
---
 polymorphic/query.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/polymorphic/query.py b/polymorphic/query.py
index ba67529..6832ea4 100644
--- a/polymorphic/query.py
+++ b/polymorphic/query.py
@@ -279,7 +279,7 @@ class PolymorphicQuerySet(QuerySet):
                 for source_expression in a.get_source_expressions():
                     if source_expression is not None:
                         test___lookup(source_expression)
-            else:
+            elif a is not None:
                 assert "___" not in a.name, ___lookup_assert_msg
 
         for a in args: