Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ietf/doc/expire.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import datetime, os, shutil, glob, re
from pathlib import Path
from zoneinfo import ZoneInfo

from typing import List, Optional # pyflakes:ignore

Expand Down Expand Up @@ -86,10 +87,13 @@ def send_expire_warning_for_draft(doc):
(doc.get_state_slug("draft") != "active")):
return # don't warn about dead or inactive documents

expiration = doc.expires.astimezone(DEADLINE_TZINFO).date()
expiration = doc.expires.astimezone(
DEADLINE_TZINFO
).replace(
hour=0, minute=0, second=0, microsecond=0
)
now_plus_12hours = timezone.now() + datetime.timedelta(hours=12)
soon = now_plus_12hours.date()
if expiration <= soon:
if expiration <= now_plus_12hours:
# The document will expire very soon, which will send email to the
# same people, so do not send the warning at this point in time
return
Expand Down
1 change: 1 addition & 0 deletions ietf/doc/tests_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ def test_warn_expirable_drafts(self):
self.assertTrue('draft-ietf-mars-test@' in outbox[-1]['To']) # Gets the authors
self.assertTrue('mars-chairs@ietf.org' in outbox[-1]['Cc'])
self.assertTrue('aread@' in outbox[-1]['Cc'])
self.assertIn('UTC' , get_payload_text(outbox[-1]))

# hack into expirable state to expire in 10 hours
draft.expires = timezone.now() + datetime.timedelta(hours=10)
Expand Down
4 changes: 2 additions & 2 deletions ietf/templates/doc/draft/expire_warning_email.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load ietf_filters %}{% autoescape off %}The following Internet-Draft will expire soon:
{% load ietf_filters tz %}{% autoescape off %}The following Internet-Draft will expire soon:

Name: {{ doc.name|clean_whitespace }}
Title: {{ doc.title}}
State: {{ state }}
Expires: {{ expiration }} (in {{ expiration|timeuntil }})
Expires: {{ expiration|utc }} (in {{ expiration|timeuntil }})
{% endautoescape %}
7 changes: 0 additions & 7 deletions ietf/templates/notify_expirations/body.txt

This file was deleted.

1 change: 0 additions & 1 deletion ietf/templates/notify_expirations/subject.txt

This file was deleted.