Skip to content

Commit 2c24715

Browse files
committed
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
1 parent deecbc9 commit 2c24715

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ietf/idtracker/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,11 @@ def document(self):
455455
else:
456456
return self.draft
457457
def comments(self):
458-
return self.documentcomment_set.all().filter(rfc_flag=self.rfc_flag).order_by('-comment_date','-comment_time')
458+
if self.rfc_flag == 0:
459+
filter = models.Q(rfc_flag=0)|models.Q(rfc_flag__isnull=True)
460+
else:
461+
filter = models.Q(rfc_flag=1)
462+
return self.documentcomment_set.all().filter(filter).order_by('-comment_date','-comment_time')
459463
def ballot_set(self):
460464
return IDInternal.objects.filter(ballot=self.ballot_id)
461465
def ballot_primary(self):

0 commit comments

Comments
 (0)