From 2c247157a4de50caa7f3adac0afb60c8669ece8e Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Mon, 11 Jun 2007 11:04:38 +0000 Subject: [PATCH] When searching for matching document comments, and rfc_flag is off, the document_comments table can have either "0" or NULL, so the join on comments.rfc_flag=self.rfc_flag was skipping the NULL ones. - Legacy-Id: 308 --- ietf/idtracker/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ietf/idtracker/models.py b/ietf/idtracker/models.py index a4bea2e7b..40138cdd0 100644 --- a/ietf/idtracker/models.py +++ b/ietf/idtracker/models.py @@ -455,7 +455,11 @@ class IDInternal(models.Model): else: return self.draft def comments(self): - return self.documentcomment_set.all().filter(rfc_flag=self.rfc_flag).order_by('-comment_date','-comment_time') + if self.rfc_flag == 0: + filter = models.Q(rfc_flag=0)|models.Q(rfc_flag__isnull=True) + else: + filter = models.Q(rfc_flag=1) + return self.documentcomment_set.all().filter(filter).order_by('-comment_date','-comment_time') def ballot_set(self): return IDInternal.objects.filter(ballot=self.ballot_id) def ballot_primary(self):