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

Signal fixed on changing allocation statuses #489

Merged
merged 3 commits into from
Feb 10, 2023

Conversation

rg663
Copy link
Collaborator

@rg663 rg663 commented Feb 9, 2023

Resolves issue #474 — Now, allocations that have been given a revoked status display a similar behavior to an allocation that has been marked as denied, sending an email to the user and signaling that the allocation should be disabled. Newlines are also added to email templates to enhance readability.

Copy link
Member

@aebruno aebruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor fixes..

@@ -232,22 +232,25 @@ def post(self, request, *args, **kwargs):
if action != 'auto-approve':
messages.success(request, 'Allocation Activated!')

elif old_status != allocation_obj.status.name in ['Denied', 'New']:
elif old_status != allocation_obj.status in ['Denied', 'New', 'Revoked']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be elif old_status != allocation_obj.status.name in ['Denied', 'New', 'Revoked']:

coldfront/core/allocation/views.py Show resolved Hide resolved
coldfront/core/allocation/views.py Outdated Show resolved Hide resolved
send_allocation_customer_email(allocation_obj, 'Allocation Denied', 'email/allocation_denied.txt', domain_url=get_domain_url(self.request))
messages.success(request, 'Allocation Denied!')
elif allocation_obj.status == 'Revoked':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be elif allocation_obj.status.name == 'Revoked':

coldfront/templates/email/allocation_revoked.txt Outdated Show resolved Hide resolved
changed references to allocation_obj.status to allocation_obj.status.name
@aebruno aebruno merged commit 22ca8c9 into ubccr:main Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants