fix: use correct doc types and states for rfcs (#6639)

This commit is contained in:
Robert Sparks 2023-11-15 08:08:39 -06:00 committed by GitHub
parent 639043e890
commit 4fa8bfa543
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -41,7 +41,7 @@ class CommunityListTests(WebTest):
clist = CommunityList.objects.create(user=User.objects.get(username="plain"))
rule_group = SearchRule.objects.create(rule_type="group", group=draft.group, state=State.objects.get(type="draft", slug="active"), community_list=clist)
rule_group_rfc = SearchRule.objects.create(rule_type="group_rfc", group=draft.group, state=State.objects.get(type="draft", slug="rfc"), community_list=clist)
rule_group_rfc = SearchRule.objects.create(rule_type="group_rfc", group=draft.group, state=State.objects.get(type="rfc", slug="published"), community_list=clist)
rule_area = SearchRule.objects.create(rule_type="area", group=draft.group.parent, state=State.objects.get(type="draft", slug="active"), community_list=clist)
rule_state_iesg = SearchRule.objects.create(rule_type="state_iesg", state=State.objects.get(type="draft-iesg", slug="lc"), community_list=clist)

View file

@ -189,7 +189,7 @@ def setup_default_community_list_for_group(group):
community_list=clist,
rule_type="group_rfc",
group=group,
state=State.objects.get(slug="rfc", type="draft"),
state=State.objects.get(slug="published", type="rfc"),
)
SearchRule.objects.create(
community_list=clist,

View file

@ -740,7 +740,7 @@ def dependencies(request, acronym, group_type=None):
relationship__slug__startswith="ref",
)
both_rfcs = Q(source__states__slug="rfc", target__states__slug="rfc")
both_rfcs = Q(source__type_id="rfc", target__type_id="rfc")
inactive = Q(source__states__slug__in=["expired", "repl"])
attractor = Q(target__name__in=["rfc5000", "rfc5741"])
removed = Q(source__states__slug__in=["auth-rm", "ietf-rm"])

View file

@ -190,7 +190,7 @@ class Person(models.Model):
def rfcs(self):
from ietf.doc.models import Document
rfcs = list(Document.objects.filter(documentauthor__person=self, type='draft', states__slug='rfc'))
rfcs = list(Document.objects.filter(documentauthor__person=self, type='rfc'))
rfcs.sort(key=lambda d: d.name )
return rfcs

View file

@ -216,7 +216,7 @@ def document_stats(request, stats_type=None):
# filter documents
document_filters = Q(type__in=["draft","rfc"]) # TODO - review lots of "rfc is a draft" assumptions below
rfc_state = State.objects.get(type="draft", slug="rfc")
rfc_state = State.objects.get(type="rfc", slug="published")
if document_type == "rfc":
document_filters &= Q(states=rfc_state)
elif document_type == "draft":
@ -370,7 +370,7 @@ def document_stats(request, stats_type=None):
person_filters = Q(documentauthor__document__type="draft")
# filter persons
rfc_state = State.objects.get(type="draft", slug="rfc")
rfc_state = State.objects.get(type="rfc", slug="published")
if document_type == "rfc":
person_filters &= Q(documentauthor__document__states=rfc_state)
elif document_type == "draft":
@ -599,7 +599,7 @@ def document_stats(request, stats_type=None):
person_filters = Q(documentauthor__document__type="draft")
# filter persons
rfc_state = State.objects.get(type="draft", slug="rfc")
rfc_state = State.objects.get(type="rfc", slug="published")
if document_type == "rfc":
person_filters &= Q(documentauthor__document__states=rfc_state)
elif document_type == "draft":