fix: Track RFC documents that came from tracked drafts

This commit is contained in:
Jennifer Richards 2023-07-22 14:23:44 -07:00
parent 938f862cc2
commit 423514467d
No known key found for this signature in database
GPG key ID: 9B2BF5C5ADDA6A6E

View file

@ -179,7 +179,11 @@ def docs_tracked_by_community_list(clist):
# in theory, we could use an OR query, but databases seem to have
# trouble with OR queries and complicated joins so do the OR'ing
# manually
doc_ids = set(clist.added_docs.values_list("pk", flat=True))
doc_ids = set()
for doc in clist.added_docs.all():
doc_ids.add(doc.pk)
doc_ids.update(alias.docs.first().pk for alias in doc.related_that_doc("became_rfc"))
for rule in clist.searchrule_set.all():
doc_ids = doc_ids | set(docs_matching_community_list_rule(rule).values_list("pk", flat=True))