[Patchew-devel] [PATCH 05/11] topic: Fix for_stripped_subject
fam at euphon.net
fam at euphon.net
Fri Sep 25 15:42:37 UTC 2020
From: Fam Zheng <fam at 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
More information about the Patchew-devel
mailing list