1010from ietf .utils .mail import send_mail , send_mail_text
1111from ietf .idtracker .models import *
1212from doc .models import WriteupEvent , BallotPositionEvent , LastCallEvent
13- from person .models import Email
13+ from person .models import Person
1414
1515def email_state_changed (request , doc , text ):
1616 to = [x .strip () for x in doc .idinternal .state_change_notice_to .replace (';' , ',' ).split (',' )]
@@ -55,7 +55,7 @@ def email_ownerREDESIGN(request, doc, owner, changed_by, text, subject=None):
5555 to = owner .formatted_email ()
5656 send_mail (request , to ,
5757 "DraftTracker Mail System <iesg-secretary@ietf.org>" ,
58- "%s updated by %s" % (doc .file_tag (), changed_by .get_name () ),
58+ "%s updated by %s" % (doc .file_tag (), changed_by .name ),
5959 "idrfc/change_notice.txt" ,
6060 dict (text = html_to_text (text ),
6161 doc = doc ,
@@ -88,9 +88,9 @@ def full_intended_status(intended_status):
8888def generate_ballot_writeup (request , doc ):
8989 e = WriteupEvent ()
9090 e .type = "changed_ballot_writeup_text"
91- e .by = request .user .get_profile (). email ()
91+ e .by = request .user .get_profile ()
9292 e .doc = doc
93- e .desc = u"Ballot writeup was generated by %s" % e .by .get_name ()
93+ e .desc = u"Ballot writeup was generated by %s" % e .by .name
9494 e .text = unicode (render_to_string ("idrfc/ballot_writeup.txt" ))
9595 e .save ()
9696
@@ -160,9 +160,9 @@ def generate_last_call_announcementREDESIGN(request, doc):
160160
161161 e = WriteupEvent ()
162162 e .type = "changed_last_call_text"
163- e .by = request .user .get_profile (). email ()
163+ e .by = request .user .get_profile ()
164164 e .doc = doc
165- e .desc = u"Last call announcement was generated by %s" % e .by .get_name ()
165+ e .desc = u"Last call announcement was generated by %s" % e .by .name
166166 e .text = unicode (mail )
167167 e .save ()
168168
@@ -255,9 +255,9 @@ def generate_approval_mailREDESIGN(request, doc):
255255
256256 e = WriteupEvent ()
257257 e .type = "changed_ballot_approval_text"
258- e .by = request .user .get_profile (). email ()
258+ e .by = request .user .get_profile ()
259259 e .doc = doc
260- e .desc = u"Ballot approval text was generated by %s" % e .by .get_name ()
260+ e .desc = u"Ballot approval text was generated by %s" % e .by .name
261261 e .text = unicode (mail )
262262 e .save ()
263263
@@ -292,12 +292,12 @@ def generate_approval_mail_approved(request, doc):
292292 made_by = "This document is the product of the %s." % doc .group .name_with_wg
293293
294294 director = doc .ad
295- other_director = Email .objects .filter (role__group__role__email = director , role__group__role__name = "ad" ).exclude (pk = director .pk )
295+ other_director = Person .objects .filter (email__role__group__role__email__person = director , email__role__group__role__name = "ad" ).exclude (pk = director .pk )
296296
297297 if doc .group .type_id != "individ" and other_director :
298- contacts = "The IESG contact persons are %s and %s." % (director .get_name () , other_director [0 ].get_name () )
298+ contacts = "The IESG contact persons are %s and %s." % (director .name , other_director [0 ].name )
299299 else :
300- contacts = "The IESG contact person is %s." % director .get_name ()
300+ contacts = "The IESG contact person is %s." % director .name
301301
302302 doc_type = "RFC" if doc .state_id == "rfc" else "Internet Draft"
303303
@@ -476,7 +476,7 @@ def generate_issue_ballot_mailREDESIGN(request, doc):
476476 full_status = full_intended_status (doc .intended_std_level .name )
477477 status = full_status .replace ("a " , "" ).replace ("an " , "" )
478478
479- active_ads = Email .objects .filter (role__name = "ad" , role__group__state = "active" )
479+ active_ads = Person .objects .filter (email__role__name = "ad" , email__role__group__state = "active" ). distinct ( )
480480
481481 e = doc .latest_event (type = "started_iesg_process" )
482482 positions = BallotPositionEvent .objects .filter (doc = doc , type = "changed_ballot_position" , time__gte = e .time ).order_by ("-time" , '-id' ).select_related ('ad' )
@@ -499,7 +499,7 @@ def formatted(val):
499499 return "[ ]"
500500
501501 fmt = u"%-21s%-10s%-11s%-9s%-10s" % (
502- p .ad .get_name () [:21 ],
502+ p .ad .name [:21 ],
503503 formatted (p .pos_id == "yes" ),
504504 formatted (p .pos_id == "noobj" ),
505505 formatted (p .pos_id == "discuss" ),
@@ -517,7 +517,7 @@ def formatted(val):
517517
518518 active_ad_positions .sort ()
519519 inactive_ad_positions .sort ()
520- ad_feedback .sort (key = lambda p : p .ad .get_name () )
520+ ad_feedback .sort (key = lambda p : p .ad .name )
521521
522522 e = doc .latest_event (LastCallEvent , type = "sent_last_call" )
523523 last_call_expires = e .expires if e else None
0 commit comments