Skip to content
Closed
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: 2 additions & 2 deletions coldfront/core/allocation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def post(self, request, *args, **kwargs):
elif action == "deny":
allocation_obj.status = AllocationStatusChoice.objects.get(name="Denied")

if old_status != "Active" == allocation_obj.status.name:
if old_status != "Active" and allocation_obj.status.name == "Active":
if not allocation_obj.start_date:
allocation_obj.start_date = datetime.datetime.now()
if "approve" in action or not allocation_obj.end_date:
Expand All @@ -284,7 +284,7 @@ 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", "Revoked"]:
elif old_status != allocation_obj.status.name and allocation_obj.status.name in ["Denied", "New", "Revoked"]:
allocation_obj.start_date = None
allocation_obj.end_date = None
allocation_obj.save()
Expand Down