From 9400df8895fd344d39aeb53d4af929d0015ee640 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Thu, 13 Jul 2023 10:10:13 -0400 Subject: [PATCH 1/2] feat: Add "generate email" to action on nominees page (#4893) --- ietf/nomcom/views.py | 4 ++++ ietf/templates/nomcom/private_index.html | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py index d43f227c08..0a91e22440 100644 --- a/ietf/nomcom/views.py +++ b/ietf/nomcom/views.py @@ -190,6 +190,7 @@ def private_index(request, year): nomcom = get_nomcom_by_year(year) all_nominee_positions = NomineePosition.objects.get_by_nomcom(nomcom).not_duplicated() is_chair = nomcom.group.has_role(request.user, "chair") + mailto = None if is_chair and request.method == 'POST': if nomcom.group.state_id != 'active': messages.warning(request, "This nomcom is not active. Request administrative assistance if Nominee state needs to change.") @@ -207,6 +208,8 @@ def private_index(request, year): elif action == "set_as_pending": nominations.update(state='pending') messages.success(request,'The selected nominations have been set as pending') + elif action == 'email': + mailto = ','.join([np.nominee.email.name_and_email() for np in nominations]) else: messages.warning(request, "Please, select some nominations to work with") @@ -278,6 +281,7 @@ def private_index(request, year): 'selected_position': selected_position and int(selected_position) or None, 'selected': 'index', 'is_chair': is_chair, + 'mailto': mailto, }) diff --git a/ietf/templates/nomcom/private_index.html b/ietf/templates/nomcom/private_index.html index 6f64a0ff78..82aadf6a19 100644 --- a/ietf/templates/nomcom/private_index.html +++ b/ietf/templates/nomcom/private_index.html @@ -234,12 +234,21 @@

+ + {% if mailto %} +
+ Mail to selected nominees + + {% endif %} {% endif %} {% endif %} {% endblock %} From f9fa298d8e4434d99d8bb89477fc5d863e980aec Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Mon, 17 Jul 2023 13:32:16 -0400 Subject: [PATCH 2/2] fix: Use bare email address for now --- ietf/nomcom/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py index 0a91e22440..1b18ae6379 100644 --- a/ietf/nomcom/views.py +++ b/ietf/nomcom/views.py @@ -209,7 +209,7 @@ def private_index(request, year): nominations.update(state='pending') messages.success(request,'The selected nominations have been set as pending') elif action == 'email': - mailto = ','.join([np.nominee.email.name_and_email() for np in nominations]) + mailto = ','.join([np.nominee.email.email_address() for np in nominations]) else: messages.warning(request, "Please, select some nominations to work with")