fix: use correct doc types and states for rfcs (#6639)
This commit is contained in:
parent
639043e890
commit
4fa8bfa543
|
@ -41,7 +41,7 @@ class CommunityListTests(WebTest):
|
||||||
clist = CommunityList.objects.create(user=User.objects.get(username="plain"))
|
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 = 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_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)
|
rule_state_iesg = SearchRule.objects.create(rule_type="state_iesg", state=State.objects.get(type="draft-iesg", slug="lc"), community_list=clist)
|
||||||
|
|
|
@ -189,7 +189,7 @@ def setup_default_community_list_for_group(group):
|
||||||
community_list=clist,
|
community_list=clist,
|
||||||
rule_type="group_rfc",
|
rule_type="group_rfc",
|
||||||
group=group,
|
group=group,
|
||||||
state=State.objects.get(slug="rfc", type="draft"),
|
state=State.objects.get(slug="published", type="rfc"),
|
||||||
)
|
)
|
||||||
SearchRule.objects.create(
|
SearchRule.objects.create(
|
||||||
community_list=clist,
|
community_list=clist,
|
||||||
|
|
|
@ -740,7 +740,7 @@ def dependencies(request, acronym, group_type=None):
|
||||||
relationship__slug__startswith="ref",
|
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"])
|
inactive = Q(source__states__slug__in=["expired", "repl"])
|
||||||
attractor = Q(target__name__in=["rfc5000", "rfc5741"])
|
attractor = Q(target__name__in=["rfc5000", "rfc5741"])
|
||||||
removed = Q(source__states__slug__in=["auth-rm", "ietf-rm"])
|
removed = Q(source__states__slug__in=["auth-rm", "ietf-rm"])
|
||||||
|
|
|
@ -190,7 +190,7 @@ class Person(models.Model):
|
||||||
|
|
||||||
def rfcs(self):
|
def rfcs(self):
|
||||||
from ietf.doc.models import Document
|
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 )
|
rfcs.sort(key=lambda d: d.name )
|
||||||
return rfcs
|
return rfcs
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,7 @@ def document_stats(request, stats_type=None):
|
||||||
# filter documents
|
# filter documents
|
||||||
document_filters = Q(type__in=["draft","rfc"]) # TODO - review lots of "rfc is a draft" assumptions below
|
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":
|
if document_type == "rfc":
|
||||||
document_filters &= Q(states=rfc_state)
|
document_filters &= Q(states=rfc_state)
|
||||||
elif document_type == "draft":
|
elif document_type == "draft":
|
||||||
|
@ -370,7 +370,7 @@ def document_stats(request, stats_type=None):
|
||||||
person_filters = Q(documentauthor__document__type="draft")
|
person_filters = Q(documentauthor__document__type="draft")
|
||||||
|
|
||||||
# filter persons
|
# filter persons
|
||||||
rfc_state = State.objects.get(type="draft", slug="rfc")
|
rfc_state = State.objects.get(type="rfc", slug="published")
|
||||||
if document_type == "rfc":
|
if document_type == "rfc":
|
||||||
person_filters &= Q(documentauthor__document__states=rfc_state)
|
person_filters &= Q(documentauthor__document__states=rfc_state)
|
||||||
elif document_type == "draft":
|
elif document_type == "draft":
|
||||||
|
@ -599,7 +599,7 @@ def document_stats(request, stats_type=None):
|
||||||
person_filters = Q(documentauthor__document__type="draft")
|
person_filters = Q(documentauthor__document__type="draft")
|
||||||
|
|
||||||
# filter persons
|
# filter persons
|
||||||
rfc_state = State.objects.get(type="draft", slug="rfc")
|
rfc_state = State.objects.get(type="rfc", slug="published")
|
||||||
if document_type == "rfc":
|
if document_type == "rfc":
|
||||||
person_filters &= Q(documentauthor__document__states=rfc_state)
|
person_filters &= Q(documentauthor__document__states=rfc_state)
|
||||||
elif document_type == "draft":
|
elif document_type == "draft":
|
||||||
|
|
Loading…
Reference in a new issue