From 7954bfe8c036d60be8318287822d7e58460282e5 Mon Sep 17 00:00:00 2001 From: Becky Smith Date: Fri, 28 Jun 2024 14:41:06 +0100 Subject: [PATCH] Remove state transition from REJECTED to APPROVED --- airlock/business_logic.py | 3 --- docs/request-states.md | 1 - tests/unit/test_business_logic.py | 3 +-- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/airlock/business_logic.py b/airlock/business_logic.py index e6821b81..3dc8ed8f 100644 --- a/airlock/business_logic.py +++ b/airlock/business_logic.py @@ -1311,9 +1311,6 @@ def get_approved_requests(self, user: User): RequestStatus.APPROVED: [ RequestStatus.RELEASED, ], - RequestStatus.REJECTED: [ - RequestStatus.APPROVED, # allow mind changed - ], } # The following lists should a) include every status and b) be disjoint diff --git a/docs/request-states.md b/docs/request-states.md index 2ec235b8..12d29253 100644 --- a/docs/request-states.md +++ b/docs/request-states.md @@ -16,6 +16,5 @@ stateDiagram-v2 RETURNED --> SUBMITTED RETURNED --> WITHDRAWN APPROVED --> RELEASED - REJECTED --> APPROVED ``` diff --git a/tests/unit/test_business_logic.py b/tests/unit/test_business_logic.py index f7f8ac38..b77ca652 100644 --- a/tests/unit/test_business_logic.py +++ b/tests/unit/test_business_logic.py @@ -839,7 +839,7 @@ def test_provider_get_current_request_for_user_output_checker(bll): (RequestStatus.REJECTED, RequestStatus.SUBMITTED, False, False, None), (RequestStatus.REJECTED, RequestStatus.PARTIALLY_REVIEWED, False, False, None), (RequestStatus.REJECTED, RequestStatus.REVIEWED, False, False, None), - (RequestStatus.REJECTED, RequestStatus.APPROVED, False, True, None), + (RequestStatus.REJECTED, RequestStatus.APPROVED, False, False, None), (RequestStatus.REJECTED, RequestStatus.WITHDRAWN, False, False, None), (RequestStatus.RELEASED, RequestStatus.PENDING, False, False, None), (RequestStatus.RELEASED, RequestStatus.SUBMITTED, False, False, None), @@ -1050,7 +1050,6 @@ def test_request_status_ownership(bll): "request_withdrawn", ), (RequestStatus.APPROVED, RequestStatus.RELEASED, "checker", "request_released"), - (RequestStatus.REJECTED, RequestStatus.APPROVED, "checker", "request_approved"), ], ) def test_set_status_notifications(