diff --git a/atst/domain/requests.py b/atst/domain/requests.py index 85fb688a..3986a849 100644 --- a/atst/domain/requests.py +++ b/atst/domain/requests.py @@ -143,6 +143,10 @@ class Requests(object): "primary_poc", ] 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 ) + + @classmethod + def is_pending_financial_verification(cls, request): + return request.status == RequestStatus.PENDING_FINANCIAL_VERIFICATION diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index ec9b566c..5e9d26ca 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -1,5 +1,5 @@ import pendulum -from flask import render_template, g +from flask import render_template, g, url_for from . import requests_bp from atst.domain.requests import Requests @@ -9,6 +9,8 @@ def map_request(request): time_created = pendulum.instance(request.time_created) is_new = time_created.add(days=1) > pendulum.now() app_count = request.body.get("details_of_use", {}).get("num_software_systems", 0) + update_url = url_for('requests.requests_form_update', screen=1, request_id=request.id) + verify_url = url_for('requests.financial_verification', request_id=request.id) return { "order_id": request.id, @@ -17,6 +19,7 @@ def map_request(request): "app_count": app_count, "date": time_created.format("M/DD/YYYY"), "full_name": request.creator.full_name, + "edit_link": verify_url if Requests.is_pending_financial_verification(request) else update_url } diff --git a/atst/routes/requests/jedi_request_flow.py b/atst/routes/requests/jedi_request_flow.py index af08251b..1a3a7163 100644 --- a/atst/routes/requests/jedi_request_flow.py +++ b/atst/routes/requests/jedi_request_flow.py @@ -76,7 +76,7 @@ class JEDIRequestFlow(object): @property def can_submit(self): - return self.request and self.request.status != "incomplete" + return self.request and Requests.should_allow_submission(self.request) @property def next_screen(self): diff --git a/templates/requests.html b/templates/requests.html index 17993dfa..25520ac2 100644 --- a/templates/requests.html +++ b/templates/requests.html @@ -88,7 +88,7 @@ {% for r in requests %}