fix: count RFCs correctly for doc/ad (#6833)

* fix: count RFCs correctly for doc/ad

* chore: improve query legibility
This commit is contained in:
Robert Sparks 2024-01-03 10:37:44 -06:00 committed by GitHub
parent 748bcc328f
commit bbc64d30fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -471,11 +471,11 @@ def ad_workload(request):
state = doc_state(doc)
state_events = doc.docevent_set.filter(
Q(type="started_iesg_process")
| Q(type="changed_state")
| Q(type="published_rfc")
| Q(type="closed_ballot"),
).order_by("-time")
type__in=["started_iesg_process", "changed_state", "closed_ballot"]
)
if doc.became_rfc():
state_events = state_events | doc.became_rfc().docevent_set.filter(type="published_rfc")
state_events = state_events.order_by("-time")
# compute state history for drafts
last = now