Skip to content

Commit c8d00e2

Browse files
committed
clarify conditionals
Signed-off-by: Simon Leary <[email protected]>
1 parent 72dbd32 commit c8d00e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coldfront/core/allocation/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def post(self, request, *args, **kwargs):
258258
elif action == "deny":
259259
allocation_obj.status = AllocationStatusChoice.objects.get(name="Denied")
260260

261-
if old_status != "Active" == allocation_obj.status.name:
261+
if old_status != "Active" and allocation_obj.status.name == "Active":
262262
if not allocation_obj.start_date:
263263
allocation_obj.start_date = datetime.datetime.now()
264264
if "approve" in action or not allocation_obj.end_date:
@@ -284,7 +284,7 @@ def post(self, request, *args, **kwargs):
284284
if action != "auto-approve":
285285
messages.success(request, "Allocation Activated!")
286286

287-
elif old_status != allocation_obj.status.name in ["Denied", "New", "Revoked"]:
287+
elif old_status != allocation_obj.status.name and allocation_obj.status.name in ["Denied", "New", "Revoked"]:
288288
allocation_obj.start_date = None
289289
allocation_obj.end_date = None
290290
allocation_obj.save()

0 commit comments

Comments
 (0)