Skip to content

Commit ba29ab8

Browse files
committed
Merged in [18723] from mrcullen42@gmail.com:
Fixes ietf-tools#3032: Only send expiration warnings for drafts with a 'draft' state of 'active', to match the drafts that we will actually expire. - Legacy-Id: 18755 Note: SVN reference [18723] has been migrated to Git commit dbeb0e8
2 parents 10c2453 + dbeb0e8 commit ba29ab8

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

ietf/doc/expire.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ def in_draft_expire_freeze(when=None):
9090
return second_cut_off <= when < ietf_monday
9191

9292
def send_expire_warning_for_draft(doc):
93-
if doc.get_state_slug("draft-iesg") == "dead":
94-
return # don't warn about dead documents
93+
94+
if ((doc.get_state_slug("draft-iesg") == "dead") or
95+
(doc.get_state_slug("draft") != "active")):
96+
return # don't warn about dead or inactive documents
9597

9698
expiration = doc.expires.date()
9799

ietf/doc/tests_draft.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,20 @@ def test_warn_expirable_drafts(self):
652652
self.assertTrue('draft-ietf-mars-test@' in outbox[-1]['To']) # Gets the authors
653653
self.assertTrue('mars-chairs@ietf.org' in outbox[-1]['Cc'])
654654
self.assertTrue('aread@' in outbox[-1]['Cc'])
655-
655+
656+
#Check that we don't sent expiration warnings for dead or replaced drafts
657+
old_state = draft.get_state_slug("draft-iesg")
658+
mailbox_before = len(outbox)
659+
draft.set_state(State.objects.get(type_id="draft-iesg",slug="dead"))
660+
send_expire_warning_for_draft(draft)
661+
self.assertEqual(len(outbox), mailbox_before,"Sent expiration warning for dead draft")
662+
draft.set_state(State.objects.get(type_id="draft-iesg",slug=old_state))
663+
664+
mailbox_before = len(outbox)
665+
draft.set_state(State.objects.get(type_id="draft",slug="repl"))
666+
send_expire_warning_for_draft(draft)
667+
self.assertEqual(len(outbox), mailbox_before,"Sent expiration warning for replaced draft")
668+
656669
def test_expire_drafts(self):
657670
mars = GroupFactory(type_id='wg',acronym='mars')
658671
ad_role = RoleFactory(group=mars, name_id='ad', person=Person.objects.get(user__username='ad'))

0 commit comments

Comments
 (0)