Skip to content

Commit

Permalink
Merge pull request #336 from fasrc/development
Browse files Browse the repository at this point in the history
add project title to allocation requests
  • Loading branch information
claire-peters committed Sep 4, 2024
2 parents d78b8f2 + ea91618 commit 40c8b34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion coldfront/core/utils/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion coldfront/templates/email/new_allocation_request.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 40c8b34

Please sign in to comment.