@@ -34,11 +34,19 @@ def in_id_expire_freeze(when=None):
3434 return second_cut_off <= when < ietf_monday
3535
3636def 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
4351def get_soon_to_expire_ids (days ):
4452 start_date = datetime .date .today () - datetime .timedelta (InternetDraft .DAYS_TO_EXPIRE - 1 )
0 commit comments