Skip to content

Commit 22cd30d

Browse files
committed
Don't email people about soon-to-expire and expired drafts in IESG state
"Dead", also fix obscure __order__gte= query on states. Fixes ietf-tools#787. - Legacy-Id: 4028
1 parent 6668404 commit 22cd30d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ietf/idrfc/expire.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def expirable_documents():
3838
# we need to get those that either don't have a state or have a
3939
# state >= 42 (AD watching), unfortunately that doesn't appear to
4040
# 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__order__gte=42).distinct())
41+
return itertools.chain(d.exclude(states__type="draft-iesg").distinct(), d.filter(states__type="draft-iesg", states__slug__in=("watching", "dead")).distinct())
4242

4343
def get_soon_to_expire_ids(days):
4444
start_date = datetime.date.today() - datetime.timedelta(InternetDraft.DAYS_TO_EXPIRE - 1)
@@ -97,6 +97,9 @@ def send_expire_warning_for_id(doc):
9797
cc_addrs)
9898

9999
def send_expire_warning_for_idREDESIGN(doc):
100+
if doc.get_state_slug("draft-iesg") == "dead":
101+
return # don't warn about dead documents
102+
100103
expiration = doc.expires.date()
101104

102105
to = [e.formatted_email() for e in doc.authors.all() if not e.address.startswith("unknown-email")]
@@ -136,7 +139,7 @@ def send_expire_notice_for_id(doc):
136139
state=doc.idstate()))
137140

138141
def send_expire_notice_for_idREDESIGN(doc):
139-
if not doc.ad:
142+
if not doc.ad or doc.get_state_slug("draft-iesg") == "dead":
140143
return
141144

142145
s = doc.get_state("draft-iesg")

0 commit comments

Comments
 (0)