diff --git a/atst/domain/requests.py b/atst/domain/requests.py index fa122d71..7532b4c2 100644 --- a/atst/domain/requests.py +++ b/atst/domain/requests.py @@ -137,6 +137,13 @@ class Requests(object): return dollar_value < cls.AUTO_APPROVE_THRESHOLD + _VALID_SUBMISSION_STATUSES = [ + RequestStatus.STARTED, + RequestStatus.PENDING_FINANCIAL_VERIFICATION, + RequestStatus.PENDING_CCPO_APPROVAL, + RequestStatus.CHANGES_REQUESTED, + ] + @classmethod def should_allow_submission(cls, request): all_request_sections = [ @@ -145,7 +152,7 @@ class Requests(object): "primary_poc", ] existing_request_sections = request.body.keys() - return request.status == RequestStatus.STARTED and all( + return request.status in Requests._VALID_SUBMISSION_STATUSES and all( section in existing_request_sections for section in all_request_sections ) diff --git a/tests/domain/test_requests.py b/tests/domain/test_requests.py index 332e3c6c..83975faf 100644 --- a/tests/domain/test_requests.py +++ b/tests/domain/test_requests.py @@ -54,6 +54,9 @@ def test_dont_auto_approve_if_no_dollar_value_specified(new_request): def test_should_allow_submission(new_request): assert Requests.should_allow_submission(new_request) + RequestStatusEventFactory.create(request=new_request, new_status=RequestStatus.PENDING_FINANCIAL_VERIFICATION) + assert Requests.should_allow_submission(new_request) + del new_request.body['details_of_use'] assert not Requests.should_allow_submission(new_request)