Skip to content

Commit 4a024d9

Browse files
authored
fix: identify editorial drafts that should not expire (#10388)
1 parent f8be143 commit 4a024d9

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

ietf/doc/expire.py

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,46 @@ def expirable_drafts(queryset=None):
3838
# Populate this first time through (but after django has been set up)
3939
if nonexpirable_states is None:
4040
# all IESG states except I-D Exists and Dead block expiry
41-
nonexpirable_states = list(State.objects.filter(used=True, type="draft-iesg").exclude(slug__in=("idexists", "dead")))
41+
nonexpirable_states = list(
42+
State.objects.filter(used=True, type="draft-iesg").exclude(
43+
slug__in=("idexists", "dead")
44+
)
45+
)
4246
# sent to RFC Editor and RFC Published block expiry (the latter
4347
# shouldn't be possible for an active draft, though)
44-
nonexpirable_states += list(State.objects.filter(used=True, type__in=("draft-stream-iab", "draft-stream-irtf", "draft-stream-ise"), slug__in=("rfc-edit", "pub")))
48+
nonexpirable_states += list(
49+
State.objects.filter(
50+
used=True,
51+
type__in=(
52+
"draft-stream-iab",
53+
"draft-stream-irtf",
54+
"draft-stream-ise",
55+
"draft-stream-editorial",
56+
),
57+
slug__in=("rfc-edit", "pub"),
58+
)
59+
)
4560
# other IRTF states that block expiration
46-
nonexpirable_states += list(State.objects.filter(used=True, type_id="draft-stream-irtf", slug__in=("irsgpoll", "iesg-rev",)))
47-
48-
return queryset.filter(
49-
states__type="draft", states__slug="active"
50-
).exclude(
51-
expires=None
52-
).exclude(
53-
states__in=nonexpirable_states
54-
).exclude(
55-
tags="rfc-rev" # under review by the RFC Editor blocks expiry
56-
).distinct()
61+
nonexpirable_states += list(
62+
State.objects.filter(
63+
used=True,
64+
type_id="draft-stream-irtf",
65+
slug__in=(
66+
"irsgpoll",
67+
"iesg-rev",
68+
),
69+
)
70+
)
71+
72+
return (
73+
queryset.filter(states__type="draft", states__slug="active")
74+
.exclude(expires=None)
75+
.exclude(states__in=nonexpirable_states)
76+
.exclude(
77+
tags="rfc-rev" # under review by the RFC Editor blocks expiry
78+
)
79+
.distinct()
80+
)
5781

5882

5983
def get_soon_to_expire_drafts(days_of_warning):

0 commit comments

Comments
 (0)