From b9f9e5b96def7597da1dbd3f5a3a1503286d9e19 Mon Sep 17 00:00:00 2001 From: dandds Date: Tue, 14 Aug 2018 10:28:24 -0400 Subject: [PATCH] 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",