Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add project title to allocation requests #336

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading