-
Notifications
You must be signed in to change notification settings - Fork 86
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
Conversation
There was a problem hiding this 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..
coldfront/core/allocation/views.py
Outdated
@@ -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']: |
There was a problem hiding this comment.
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
Outdated
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': |
There was a problem hiding this comment.
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':
changed references to allocation_obj.status to allocation_obj.status.name
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.