From ea91618bf6a7286956672abcbb05d3ab2f9b43bf Mon Sep 17 00:00:00 2001 From: geistling <34081638+geistling@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:09:33 -0400 Subject: [PATCH] add project title to allocation requests --- coldfront/core/utils/mail.py | 4 +++- coldfront/templates/email/new_allocation_change_request.txt | 2 +- coldfront/templates/email/new_allocation_request.txt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/coldfront/core/utils/mail.py b/coldfront/core/utils/mail.py index 1885d0037..2695fb1ec 100644 --- a/coldfront/core/utils/mail.py +++ b/coldfront/core/utils/mail.py @@ -94,8 +94,10 @@ def send_allocation_admin_email( pi = allocation_obj.project.pi pi_name = f'{pi.first_name} {pi.last_name}' resource_name = allocation_obj.get_parent_resource + project_title = allocation_obj.project.title ctx = email_template_context(other_vars) + ctx['project_title'] = project_title ctx['pi_name'] = pi_name ctx['pi_username'] = f'{pi.username}' ctx['resource'] = resource_name @@ -105,7 +107,7 @@ def send_allocation_admin_email( if ctx.get('user'): cc.append(ctx.get('user').email) send_email_template( - f'{subject}: {pi_name} - {resource_name}', + f'{subject}: {project_title} - {resource_name}', template_name, ctx, EMAIL_SENDER, diff --git a/coldfront/templates/email/new_allocation_change_request.txt b/coldfront/templates/email/new_allocation_change_request.txt index 5d2e0035e..5404c4c29 100644 --- a/coldfront/templates/email/new_allocation_change_request.txt +++ b/coldfront/templates/email/new_allocation_change_request.txt @@ -1,5 +1,5 @@ {% load mathfilters %} -An allocation change request for has been made for {{pi_name}} ({{pi_username}}) - {{resource}}. +An allocation change request for has been made for {{pi_name}} ({{pi_username}}) project {{project_title}} - {{resource}}. The request was made by user {{user.full_name}} ({{user.username}}). This user's email is {{user.email}} {% if quantity %} diff --git a/coldfront/templates/email/new_allocation_request.txt b/coldfront/templates/email/new_allocation_request.txt index 65d466b84..7aad3356d 100644 --- a/coldfront/templates/email/new_allocation_request.txt +++ b/coldfront/templates/email/new_allocation_request.txt @@ -1,5 +1,5 @@ {% load mathfilters %} -A new allocation has been requested for {{pi_name}} ({{pi_username}}) - {{resource}}. +A new allocation has been requested for {{pi_name}} ({{pi_username}}) project {{project_title}} - {{resource}}. The request was made by user {{user.full_name}} ({{user.username}}). This user's email is {{user.email}} Requested size: {{quantity}} TB.