Skip to content

Commit 4fa8bfa

Browse files
authored
fix: use correct doc types and states for rfcs (ietf-tools#6639)
1 parent 639043e commit 4fa8bfa

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

ietf/community/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_rule_matching(self):
4141
clist = CommunityList.objects.create(user=User.objects.get(username="plain"))
4242

4343
rule_group = SearchRule.objects.create(rule_type="group", group=draft.group, state=State.objects.get(type="draft", slug="active"), community_list=clist)
44-
rule_group_rfc = SearchRule.objects.create(rule_type="group_rfc", group=draft.group, state=State.objects.get(type="draft", slug="rfc"), community_list=clist)
44+
rule_group_rfc = SearchRule.objects.create(rule_type="group_rfc", group=draft.group, state=State.objects.get(type="rfc", slug="published"), community_list=clist)
4545
rule_area = SearchRule.objects.create(rule_type="area", group=draft.group.parent, state=State.objects.get(type="draft", slug="active"), community_list=clist)
4646

4747
rule_state_iesg = SearchRule.objects.create(rule_type="state_iesg", state=State.objects.get(type="draft-iesg", slug="lc"), community_list=clist)

ietf/group/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def setup_default_community_list_for_group(group):
189189
community_list=clist,
190190
rule_type="group_rfc",
191191
group=group,
192-
state=State.objects.get(slug="rfc", type="draft"),
192+
state=State.objects.get(slug="published", type="rfc"),
193193
)
194194
SearchRule.objects.create(
195195
community_list=clist,

ietf/group/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ def dependencies(request, acronym, group_type=None):
740740
relationship__slug__startswith="ref",
741741
)
742742

743-
both_rfcs = Q(source__states__slug="rfc", target__states__slug="rfc")
743+
both_rfcs = Q(source__type_id="rfc", target__type_id="rfc")
744744
inactive = Q(source__states__slug__in=["expired", "repl"])
745745
attractor = Q(target__name__in=["rfc5000", "rfc5741"])
746746
removed = Q(source__states__slug__in=["auth-rm", "ietf-rm"])

ietf/person/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def has_drafts(self):
190190

191191
def rfcs(self):
192192
from ietf.doc.models import Document
193-
rfcs = list(Document.objects.filter(documentauthor__person=self, type='draft', states__slug='rfc'))
193+
rfcs = list(Document.objects.filter(documentauthor__person=self, type='rfc'))
194194
rfcs.sort(key=lambda d: d.name )
195195
return rfcs
196196

ietf/stats/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def build_document_stats_url(stats_type_override=Ellipsis, get_overrides=None):
216216
# filter documents
217217
document_filters = Q(type__in=["draft","rfc"]) # TODO - review lots of "rfc is a draft" assumptions below
218218

219-
rfc_state = State.objects.get(type="draft", slug="rfc")
219+
rfc_state = State.objects.get(type="rfc", slug="published")
220220
if document_type == "rfc":
221221
document_filters &= Q(states=rfc_state)
222222
elif document_type == "draft":
@@ -370,7 +370,7 @@ def build_document_stats_url(stats_type_override=Ellipsis, get_overrides=None):
370370
person_filters = Q(documentauthor__document__type="draft")
371371

372372
# filter persons
373-
rfc_state = State.objects.get(type="draft", slug="rfc")
373+
rfc_state = State.objects.get(type="rfc", slug="published")
374374
if document_type == "rfc":
375375
person_filters &= Q(documentauthor__document__states=rfc_state)
376376
elif document_type == "draft":
@@ -599,7 +599,7 @@ def build_document_stats_url(stats_type_override=Ellipsis, get_overrides=None):
599599
person_filters = Q(documentauthor__document__type="draft")
600600

601601
# filter persons
602-
rfc_state = State.objects.get(type="draft", slug="rfc")
602+
rfc_state = State.objects.get(type="rfc", slug="published")
603603
if document_type == "rfc":
604604
person_filters &= Q(documentauthor__document__states=rfc_state)
605605
elif document_type == "draft":

0 commit comments

Comments
 (0)