From b9f9e5b96def7597da1dbd3f5a3a1503286d9e19 Mon Sep 17 00:00:00 2001 From: dandds Date: Tue, 14 Aug 2018 10:28:24 -0400 Subject: [PATCH 1/2] CCPO should not see request status alerts --- atst/routes/requests/index.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index 5b7984ee..8f21ad8c 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -3,6 +3,7 @@ from flask import render_template, g, url_for from . import requests_bp from atst.domain.requests import Requests +from atst.models.permissions import Permissions def map_request(request): @@ -30,15 +31,16 @@ def map_request(request): @requests_bp.route("/requests", methods=["GET"]) def requests_index(): requests = [] - if "review_and_approve_jedi_workspace_request" in g.current_user.atat_permissions: + is_ccpo = Permissions.REVIEW_AND_APPROVE_JEDI_WORKSPACE_REQUEST in g.current_user.atat_permissions + if is_ccpo: requests = Requests.get_many() else: requests = Requests.get_many(creator=g.current_user) mapped_requests = [map_request(r) for r in 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) + pending_fv = any(Requests.is_pending_financial_verification(r) for r in requests) and not is_ccpo + pending_ccpo = any(Requests.is_pending_ccpo_approval(r) for r in requests) and not is_ccpo return render_template( "requests.html", From df5b93c2446738a2689950a2cd31557b4b5e465b Mon Sep 17 00:00:00 2001 From: dandds Date: Tue, 14 Aug 2018 10:43:49 -0400 Subject: [PATCH 2/2] rearrange requests alerts conditional check --- atst/routes/requests/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index 8f21ad8c..d24e2a2c 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -39,8 +39,8 @@ 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) and not is_ccpo - pending_ccpo = any(Requests.is_pending_ccpo_approval(r) for r in requests) and not is_ccpo + pending_fv = not is_ccpo and any(Requests.is_pending_financial_verification(r) for r in requests) + pending_ccpo = not is_ccpo and any(Requests.is_pending_ccpo_approval(r) for r in requests) return render_template( "requests.html",