Skip to content

Commit c20d969

Browse files
committed
Merged [2673] from rjsparks@nostrum.com:
Refined the email sent when an position changes. Added a helper to Position to get the current position description as a string This fixes issue ietf-tools#547. - Legacy-Id: 2674 Note: SVN reference [2673] has been migrated to Git commit 770429b
1 parent dc833b4 commit c20d969

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

ietf/idrfc/views_ballot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,15 @@ def send_ballot_comment(request, name):
228228
c = comment.text
229229
subj.append("COMMENT")
230230

231+
231232
ad_name = str(ad)
232233
ad_name_genitive = ad_name + "'" if ad_name.endswith('s') else ad_name + "'s"
233-
subject = "%s %s on %s" % (ad_name_genitive, " and ".join(subj), doc.filename + '-' + doc.revision_display())
234+
subject = "%s %s on %s" % (ad_name_genitive, pos.name() if pos else "No Position" , doc.filename + '-' + doc.revision_display())
235+
if subj:
236+
subject += ": (with "+" and ".join(subj)+")"
237+
234238
body = render_to_string("idrfc/ballot_comment_mail.txt",
235-
dict(discuss=d, comment=c, ad=ad, doc=doc))
239+
dict(discuss=d, comment=c, ad=ad, doc=doc, pos=pos))
236240
frm = u"%s <%s>" % ad.person.email()
237241
to = "The IESG <iesg@ietf.org>"
238242

ietf/idtracker/models.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,20 @@ def abstain_ind(self):
710710
return 'X'
711711
else:
712712
return ' '
713+
def name(self):
714+
positions = {"yes":"Yes",
715+
"noobj":"No Objection",
716+
"discuss":"Discuss",
717+
"abstain":"Abstain",
718+
"recuse":"Recuse"}
719+
p = None
720+
for k,v in positions.iteritems():
721+
if self.__dict__[k] > 0:
722+
p = v
723+
if not p:
724+
p = "No Record"
725+
return p
726+
713727
class Meta:
714728
db_table = 'ballots'
715729
unique_together = (('ballot', 'ad'), )

ietf/templates/idrfc/ballot_comment_mail.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ ad }} has entered the following ballot position for
2-
{{ doc.filename }}-{{ doc.revision_display }}.
2+
{{ doc.filename }}-{{ doc.revision_display }}: {{ pos.name }}
33

44
When responding, please keep the subject line intact and reply to all
55
email addresses included in the To and CC lines. (Feel free to cut this
@@ -8,6 +8,9 @@ introductory paragraph, however.)
88
Please refer to http://www.ietf.org/iesg/statement/discuss-criteria.html
99
for more information about IESG DISCUSS and COMMENT positions.
1010

11+
{% if not discuss and not comment %}
12+
There is no DISCUSS or COMMENT text associated with this position.
13+
{% endif %}
1114

1215
{% if discuss %}----------------------------------------------------------------------
1316
DISCUSS:

0 commit comments

Comments
 (0)