[Patchew-devel] [PATCH 05/11] topic: Fix for_stripped_subject

fam@euphon.net posted 11 patches 4 years ago
[Patchew-devel] [PATCH 05/11] topic: Fix for_stripped_subject
Posted by fam@euphon.net 4 years ago
From: Fam Zheng <fam@euphon.net>

We are looking for a topic here, so including any message that happends
to have the same stripped_subject but doesn't have topic is moot and
will lead to an exception.
---
 api/models.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/api/models.py b/api/models.py
index 69b6817..fd6990f 100644
--- a/api/models.py
+++ b/api/models.py
@@ -544,7 +544,7 @@ class QueuedSeries(models.Model):
 class TopicManager(models.Manager):
     def for_stripped_subject(self, stripped_subject):
         q = (
-            Message.objects.filter(stripped_subject=stripped_subject)
+            Message.objects.filter(stripped_subject=stripped_subject, topic__isnull=False)
             .order_by("date")
             .reverse()[:1]
             .values("topic")
-- 
2.25.1



_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel