Use helper method for allowing submission
This commit is contained in:
parent
115c84680c
commit
e1da908f93
@ -143,7 +143,7 @@ class Requests(object):
|
|||||||
"primary_poc",
|
"primary_poc",
|
||||||
]
|
]
|
||||||
existing_request_sections = request.body.keys()
|
existing_request_sections = request.body.keys()
|
||||||
return request.status == "incomplete" and all(
|
return request.status == RequestStatus.STARTED and all(
|
||||||
section in existing_request_sections for section in all_request_sections
|
section in existing_request_sections for section in all_request_sections
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class JEDIRequestFlow(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def can_submit(self):
|
def can_submit(self):
|
||||||
return self.request and self.request.status != "incomplete"
|
return self.request and Requests.should_allow_submission(self.request)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def next_screen(self):
|
def next_screen(self):
|
||||||
|
@ -50,6 +50,13 @@ def test_dont_auto_approve_if_no_dollar_value_specified(new_request):
|
|||||||
assert request.status == RequestStatus.PENDING_CCPO_APPROVAL
|
assert request.status == RequestStatus.PENDING_CCPO_APPROVAL
|
||||||
|
|
||||||
|
|
||||||
|
def test_should_allow_submission(new_request):
|
||||||
|
assert Requests.should_allow_submission(new_request)
|
||||||
|
|
||||||
|
del new_request.body['details_of_use']
|
||||||
|
assert not Requests.should_allow_submission(new_request)
|
||||||
|
|
||||||
|
|
||||||
def test_exists(session):
|
def test_exists(session):
|
||||||
user_allowed = UserFactory.create()
|
user_allowed = UserFactory.create()
|
||||||
user_denied = UserFactory.create()
|
user_denied = UserFactory.create()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user