fix PT #159889979, allow resubmission of previously submitted form
This commit is contained in:
parent
24c041811f
commit
293aba230b
@ -137,6 +137,13 @@ class Requests(object):
|
|||||||
|
|
||||||
return dollar_value < cls.AUTO_APPROVE_THRESHOLD
|
return dollar_value < cls.AUTO_APPROVE_THRESHOLD
|
||||||
|
|
||||||
|
_VALID_SUBMISSION_STATUSES = [
|
||||||
|
RequestStatus.STARTED,
|
||||||
|
RequestStatus.PENDING_FINANCIAL_VERIFICATION,
|
||||||
|
RequestStatus.PENDING_CCPO_APPROVAL,
|
||||||
|
RequestStatus.CHANGES_REQUESTED,
|
||||||
|
]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def should_allow_submission(cls, request):
|
def should_allow_submission(cls, request):
|
||||||
all_request_sections = [
|
all_request_sections = [
|
||||||
@ -145,7 +152,7 @@ class Requests(object):
|
|||||||
"primary_poc",
|
"primary_poc",
|
||||||
]
|
]
|
||||||
existing_request_sections = request.body.keys()
|
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
|
section in existing_request_sections for section in all_request_sections
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -54,6 +54,9 @@ def test_dont_auto_approve_if_no_dollar_value_specified(new_request):
|
|||||||
def test_should_allow_submission(new_request):
|
def test_should_allow_submission(new_request):
|
||||||
assert Requests.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']
|
del new_request.body['details_of_use']
|
||||||
assert not Requests.should_allow_submission(new_request)
|
assert not Requests.should_allow_submission(new_request)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user