From 906484a327e8c07d50b0583b8fd0358db90ab9b6 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 4 May 2011 18:13:53 +0000 Subject: [PATCH] We cannot currently assume that BallotInfo entries matching IDInternal.ballot exists. It seems ballot may be set to a value before the actual ballot entry is created, possibly by some old secretariat tool. Very broken, but we need to survive it :-( - Legacy-Id: 3095 --- ietf/submit/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ietf/submit/utils.py b/ietf/submit/utils.py index 6016c6e45..a8ff1d987 100644 --- a/ietf/submit/utils.py +++ b/ietf/submit/utils.py @@ -112,10 +112,13 @@ def announce_new_version(submission, draft, state_change_msg): to_email.append(draft.idinternal.state_change_notice_to) if draft.idinternal.job_owner: to_email.append(draft.idinternal.job_owner.person.email()[1]) - if draft.idinternal.ballot: - for p in draft.idinternal.ballot.positions.all(): - if p.discuss == 1 and p.ad.user_level == IESGLogin.AD_LEVEL: - to_email.append(p.ad.person.email()[1]) + try: + if draft.idinternal.ballot: + for p in draft.idinternal.ballot.positions.all(): + if p.discuss == 1 and p.ad.user_level == IESGLogin.AD_LEVEL: + to_email.append(p.ad.person.email()[1]) + except BallotInfo.DoesNotExist: + pass subject = 'New Version Notification - %s-%s.txt' % (submission.filename, submission.revision) from_email = settings.IDSUBMIT_ANNOUNCE_FROM_EMAIL send_mail(None, to_email, from_email, subject, 'submit/announce_new_version.txt',