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
This commit is contained in:
Bill Fenner 2007-06-11 11:04:38 +00:00
parent deecbc9da3
commit 2c247157a4

View file

@ -455,7 +455,11 @@ class IDInternal(models.Model):
else: else:
return self.draft return self.draft
def comments(self): 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): def ballot_set(self):
return IDInternal.objects.filter(ballot=self.ballot_id) return IDInternal.objects.filter(ballot=self.ballot_id)
def ballot_primary(self): def ballot_primary(self):