Skip to content

Commit

Permalink
Verify that add_state_change_event returned something before trying t…
Browse files Browse the repository at this point in the history
…o use attributes of the return value. Fixes bug #1566. Commit ready for merge.

 - Legacy-Id: 8801
  • Loading branch information
rjsparks committed Dec 18, 2014
1 parent f532527 commit 601575a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ietf/doc/views_ballot.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def do_undefer_ballot(request, doc):
doc.save()

update_telechat(request, doc, login, telechat_date)
email_state_changed(request, doc, e.desc)
if e:
email_state_changed(request, doc, e.desc)
email_ballot_undeferred(request, doc, login.plain_name(), telechat_date)

def position_to_ballot_choice(position):
Expand Down Expand Up @@ -360,7 +361,8 @@ def defer_ballot(request, name):
doc.time = (e and e.time) or datetime.datetime.now()
doc.save()

email_state_changed(request, doc, e.desc)
if e:
email_state_changed(request, doc, e.desc)

update_telechat(request, doc, login, telechat_date)
email_ballot_deferred(request, doc, login.plain_name(), telechat_date)
Expand Down Expand Up @@ -454,8 +456,9 @@ def lastcalltext(request, name):
doc.time = (e and e.time) or datetime.datetime.now()
doc.save()

email_state_changed(request, doc, e.desc)
email_ad(request, doc, doc.ad, login, e.desc)
if e:
email_state_changed(request, doc, e.desc)
email_ad(request, doc, doc.ad, login, e.desc)

request_last_call(request, doc)

Expand Down

0 comments on commit 601575a

Please sign in to comment.