diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index f756836f..57e7e63a 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -9,8 +9,10 @@ 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) + 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, @@ -19,7 +21,9 @@ 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 + "edit_link": verify_url if Requests.is_pending_financial_verification( + request + ) else update_url, } @@ -33,6 +37,15 @@ def requests_index(): mapped_requests = [map_request(r) for r in requests] - pending_fv = any(Requests.is_pending_financial_verification(r) for r in requests) + pending_fv_count = [ + True for r in requests if Requests.is_pending_financial_verification(r) + ] + pending_fv = len(pending_fv_count) > 1 + pending_ccpo = len(pending_fv_count) != len(mapped_requests) - return render_template("requests.html", requests=mapped_requests, pending_financial_verification=pending_fv) + return render_template( + "requests.html", + requests=mapped_requests, + pending_financial_verification=pending_fv, + pending_ccpo_approval=pending_ccpo, + ) diff --git a/templates/requests.html b/templates/requests.html index 6b1e36f0..4f8c5cc1 100644 --- a/templates/requests.html +++ b/templates/requests.html @@ -42,6 +42,12 @@ {% endif %} + {% if pending_ccpo_approval %} + + {{ Alert('Request submitted. Approval pending.', fragment="fragments/pending_ccpo_approval_alert.html") }} + + {% endif %} +