From e7f90214c547493e1dfd27dacd9c181af1d19a28 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Wed, 10 Feb 2016 15:37:58 +0000 Subject: [PATCH] Handle expiring the last call of status change documents. Be more robust about errors when expiring last calls. Fixes #1911. Commit ready for merge. - Legacy-Id: 10811 --- ietf/bin/expire-last-calls | 7 +++++-- ietf/doc/mails.py | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ietf/bin/expire-last-calls b/ietf/bin/expire-last-calls index d296b3740..9c460b267 100755 --- a/ietf/bin/expire-last-calls +++ b/ietf/bin/expire-last-calls @@ -14,5 +14,8 @@ from ietf.doc.lastcall import * drafts = get_expired_last_calls() for doc in drafts: - expire_last_call(doc) - syslog.syslog("Expired last call for %s (id=%s)" % (doc.file_tag(), doc.pk)) + try: + expire_last_call(doc) + syslog.syslog("Expired last call for %s (id=%s)" % (doc.file_tag(), doc.pk)) + except Exception as e: + syslog.syslog(syslog.LOG_ERR, "ERROR: Failed to expire last call for %s (id=%s)" % (doc.file_tag(), doc.pk)) diff --git a/ietf/doc/mails.py b/ietf/doc/mails.py index 61bc928e6..73627baa8 100644 --- a/ietf/doc/mails.py +++ b/ietf/doc/mails.py @@ -357,7 +357,9 @@ def extra_automation_headers(doc): return extra def email_last_call_expired(doc): - text = "IETF Last Call has ended, and the state has been changed to\n%s." % doc.get_state("draft-iesg").name + if not doc.type_id in ['draft','statchg']: + return + text = "IETF Last Call has ended, and the state has been changed to\n%s." % doc.get_state("draft-iesg" if doc.type_id == 'draft' else "statchg").name addrs = gather_address_lists('last_call_expired',doc=doc) send_mail(None,