From 1387423a1c91aab8531170e06a2f9a8ce728fb6b Mon Sep 17 00:00:00 2001 From: dandds Date: Mon, 13 Aug 2018 11:03:23 -0400 Subject: [PATCH] fix "pending CCPO approval" alert display logic --- atst/domain/requests.py | 4 ++++ atst/routes/requests/index.py | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/atst/domain/requests.py b/atst/domain/requests.py index 3986a849..23290085 100644 --- a/atst/domain/requests.py +++ b/atst/domain/requests.py @@ -150,3 +150,7 @@ class Requests(object): @classmethod def is_pending_financial_verification(cls, request): return request.status == RequestStatus.PENDING_FINANCIAL_VERIFICATION + + @classmethod + def is_pending_ccpo_approval(cls, request): + return request.status == RequestStatus.PENDING_CCPO_APPROVAL diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index 57e7e63a..5b7984ee 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -37,11 +37,8 @@ def requests_index(): mapped_requests = [map_request(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) + pending_fv = any(Requests.is_pending_financial_verification(r) for r in requests) + pending_ccpo = any(Requests.is_pending_ccpo_approval(r) for r in requests) return render_template( "requests.html",