@@ -212,10 +212,10 @@ def validate_public_key(public_key):
212212def send_accept_reminder_to_nominee (nominee_position ):
213213 today = datetime .date .today ().strftime ('%Y%m%d' )
214214 subject = 'Reminder: please accept (or decline) your nomination.'
215- from_email = settings .NOMCOM_FROM_EMAIL
216215 domain = Site .objects .get_current ().domain
217216 position = nominee_position .position
218217 nomcom = position .nomcom
218+ from_email = settings .NOMCOM_FROM_EMAIL .format (year = nomcom .year ())
219219 nomcom_template_path = '/nomcom/%s/' % nomcom .group .acronym
220220 mail_path = nomcom_template_path + NOMINEE_ACCEPT_REMINDER_TEMPLATE
221221 nominee = nominee_position .nominee
@@ -241,18 +241,20 @@ def send_accept_reminder_to_nominee(nominee_position):
241241 'position' : position ,
242242 'domain' : domain ,
243243 'accept_url' : accept_url ,
244- 'decline_url' : decline_url }
244+ 'decline_url' : decline_url ,
245+ 'year' : nomcom .year (),
246+ }
245247 body = render_to_string (mail_path , context )
246248 path = '%s%d/%s' % (nomcom_template_path , position .id , QUESTIONNAIRE_TEMPLATE )
247249 body += '\n \n %s' % render_to_string (path , context )
248250 send_mail_text (None , to_email , from_email , subject , body , cc = cc )
249251
250252def send_questionnaire_reminder_to_nominee (nominee_position ):
251253 subject = 'Reminder: please complete the Nomcom questionnaires for your nomination.'
252- from_email = settings .NOMCOM_FROM_EMAIL
253254 domain = Site .objects .get_current ().domain
254255 position = nominee_position .position
255256 nomcom = position .nomcom
257+ from_email = settings .NOMCOM_FROM_EMAIL .format (year = nomcom .year ())
256258 nomcom_template_path = '/nomcom/%s/' % nomcom .group .acronym
257259 mail_path = nomcom_template_path + NOMINEE_QUESTIONNAIRE_REMINDER_TEMPLATE
258260 nominee = nominee_position .nominee
@@ -261,7 +263,8 @@ def send_questionnaire_reminder_to_nominee(nominee_position):
261263 context = {'nominee' : nominee ,
262264 'position' : position ,
263265 'domain' : domain ,
264- }
266+ 'year' : nomcom .year (),
267+ }
265268 body = render_to_string (mail_path , context )
266269 path = '%s%d/%s' % (nomcom_template_path , position .id , QUESTIONNAIRE_TEMPLATE )
267270 body += '\n \n %s' % render_to_string (path , context )
@@ -296,42 +299,46 @@ def make_nomineeposition(nomcom, candidate, position, author):
296299 if nominee_position_created :
297300 # send email to nominee
298301 subject = 'IETF Nomination Information'
299- from_email = settings .NOMCOM_FROM_EMAIL
302+ from_email = settings .NOMCOM_FROM_EMAIL . format ( year = nomcom . year ())
300303 (to_email , cc ) = gather_address_lists ('nomination_new_nominee' ,nominee = nominee .email .address )
301304 domain = Site .objects .get_current ().domain
302305 today = datetime .date .today ().strftime ('%Y%m%d' )
303306 hash = get_hash_nominee_position (today , nominee_position .id )
304307 accept_url = reverse ('ietf.nomcom.views.process_nomination_status' ,
305308 None ,
306- args = (get_year_by_nomcom ( nomcom ),
309+ args = (nomcom . year ( ),
307310 nominee_position .id ,
308311 'accepted' ,
309312 today ,
310313 hash ))
311314 decline_url = reverse ('ietf.nomcom.views.process_nomination_status' ,
312315 None ,
313- args = (get_year_by_nomcom ( nomcom ),
316+ args = (nomcom . year ( ),
314317 nominee_position .id ,
315318 'declined' ,
316319 today ,
317320 hash ))
318321
319322 context = {'nominee' : nominee .person .name ,
320323 'position' : position .name ,
324+ 'year' : nomcom .year (),
321325 'domain' : domain ,
322326 'accept_url' : accept_url ,
323- 'decline_url' : decline_url }
327+ 'decline_url' : decline_url ,
328+ }
324329
325330 path = nomcom_template_path + NOMINEE_EMAIL_TEMPLATE
326331 send_mail (None , to_email , from_email , subject , path , context , cc = cc )
327332
328333 # send email to nominee with questionnaire
329334 if nomcom .send_questionnaire :
330335 subject = '%s Questionnaire' % position
331- from_email = settings .NOMCOM_FROM_EMAIL
336+ from_email = settings .NOMCOM_FROM_EMAIL . format ( year = nomcom . year ())
332337 (to_email , cc ) = gather_address_lists ('nomcom_questionnaire' ,nominee = nominee .email .address )
333338 context = {'nominee' : nominee .person .name ,
334- 'position' : position .name }
339+ 'position' : position .name ,
340+ 'year' : nomcom .year (),
341+ }
335342 path = '%s%d/%s' % (nomcom_template_path ,
336343 position .id , HEADER_QUESTIONNAIRE_TEMPLATE )
337344 body = render_to_string (path , context )
@@ -342,11 +349,13 @@ def make_nomineeposition(nomcom, candidate, position, author):
342349
343350 # send emails to nomcom chair
344351 subject = 'Nomination Information'
345- from_email = settings .NOMCOM_FROM_EMAIL
352+ from_email = settings .NOMCOM_FROM_EMAIL . format ( year = nomcom . year ())
346353 (to_email , cc ) = gather_address_lists ('nomination_received' ,nomcom = nomcom )
347354 context = {'nominee' : nominee .person .name ,
348355 'nominee_email' : nominee .email .address ,
349- 'position' : position .name }
356+ 'position' : position .name ,
357+ 'year' : nomcom .year (),
358+ }
350359
351360 if author :
352361 context .update ({'nominator' : author .person .name ,
@@ -372,11 +381,13 @@ def make_nomineeposition_for_newperson(nomcom, candidate_name, candidate_email,
372381
373382 # send email to secretariat and nomcomchair to warn about the new person
374383 subject = 'New person is created'
375- from_email = settings .NOMCOM_FROM_EMAIL
384+ from_email = settings .NOMCOM_FROM_EMAIL . format ( year = nomcom . year ())
376385 (to_email , cc ) = gather_address_lists ('nomination_created_person' ,nomcom = nomcom )
377386 context = {'email' : email .address ,
378387 'fullname' : email .person .name ,
379- 'person_id' : email .person .id }
388+ 'person_id' : email .person .id ,
389+ 'year' : nomcom .year (),
390+ }
380391 nomcom_template_path = '/nomcom/%s/' % nomcom .group .acronym
381392 path = nomcom_template_path + INEXISTENT_PERSON_TEMPLATE
382393 send_mail (None , to_email , from_email , subject , path , context , cc = cc )
0 commit comments