Skip to content

Commit 8cbdc0b

Browse files
committed
Augment expiry rules so that alternate stream documents aren't expired
when they've been sent to the RFC Editor (but not yet published) - Legacy-Id: 4847
1 parent 07490fc commit 8cbdc0b

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

ietf/idrfc/expire.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,19 @@ def in_id_expire_freeze(when=None):
3434
return second_cut_off <= when < ietf_monday
3535

3636
def expirable_documents():
37+
# the general rule is that each active draft is expirable, unless
38+
# it's in a state where we shouldn't touch it
39+
3740
d = Document.objects.filter(states__type="draft", states__slug="active").exclude(tags="rfc-rev")
38-
# we need to get those that either don't have a state or have a
39-
# state >= 42 (AD watching), unfortunately that doesn't appear to
40-
# be possible to get to work directly in Django 1.1
41-
return itertools.chain(d.exclude(states__type="draft-iesg").distinct(), d.filter(states__type="draft-iesg", states__slug__in=("watching", "dead")).distinct())
41+
42+
nonexpirable_states = []
43+
# all IESG states except AD Watching and Dead block expiry
44+
nonexpirable_states += list(State.objects.filter(type="draft-iesg").exclude(slug__in=("watching", "dead")))
45+
# Sent to RFC Editor and RFC Published block expiry (the latter
46+
# shouldn't be possible for an active draft, though)
47+
nonexpirable_states += list(State.objects.filter(type__in=("draft-stream-iab", "draft-stream-irtf", "draft-stream-ise"), slug__in=("rfc-edit", "pub")))
48+
49+
return d.exclude(states__in=nonexpirable_states).distinct()
4250

4351
def get_soon_to_expire_ids(days):
4452
start_date = datetime.date.today() - datetime.timedelta(InternetDraft.DAYS_TO_EXPIRE - 1)

0 commit comments

Comments
 (0)