Skip to content

Commit f81dd9a

Browse files
committed
Compose the mail with the questionnaire using the header template and the questionnaire template. See ietf-tools#913, ietf-tools#929
- Legacy-Id: 5599
1 parent 85ab39f commit f81dd9a

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

ietf/nomcom/decorators.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ def _is_nomcom_member(user, *args, **kwargs):
1212
year = kwargs.get('year', None)
1313
if year:
1414
nomcom = get_nomcom_by_year(year=year)
15-
if has_role(user, "Secretariat"):
16-
return True
1715
if role == 'chair':
1816
return nomcom.group.is_chair(user)
1917
else:

ietf/nomcom/forms.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from ietf.dbtemplate.forms import DBTemplateForm
1616
from ietf.utils import unaccent
17-
from ietf.utils.mail import send_mail
17+
from ietf.utils.mail import send_mail, send_mail_text
1818
from ietf.ietfauth.decorators import role_required
1919
from ietf.utils import fields as custom_fields
2020
from ietf.group.models import Group, Role
@@ -25,7 +25,8 @@
2525
from ietf.nomcom.utils import QUESTIONNAIRE_TEMPLATE, NOMINATION_EMAIL_TEMPLATE, \
2626
INEXISTENT_PERSON_TEMPLATE, NOMINEE_EMAIL_TEMPLATE, \
2727
NOMINATION_RECEIPT_TEMPLATE, FEEDBACK_RECEIPT_TEMPLATE, \
28-
get_user_email, get_hash_nominee_position, get_year_by_nomcom
28+
get_user_email, get_hash_nominee_position, get_year_by_nomcom, \
29+
HEADER_QUESTIONNAIRE_TEMPLATE
2930
from ietf.nomcom.decorators import member_required
3031

3132
ROLODEX_URL = getattr(settings, 'ROLODEX_URL', None)
@@ -426,9 +427,13 @@ def save(self, commit=True):
426427
to_email = email.address
427428
context = {'nominee': email.person.name,
428429
'position': position.name}
430+
path = '%s%d/%s' % (nomcom_template_path,
431+
position.id, HEADER_QUESTIONNAIRE_TEMPLATE)
432+
body = render_to_string(path, context)
429433
path = '%s%d/%s' % (nomcom_template_path,
430434
position.id, QUESTIONNAIRE_TEMPLATE)
431-
send_mail(None, to_email, from_email, subject, path, context)
435+
body += '\n\n%s' % render_to_string(path, context)
436+
send_mail_text(None, to_email, from_email, subject, body)
432437

433438
# send emails to nomcom chair
434439
subject = 'Nomination Information'

0 commit comments

Comments
 (0)