Add route for read-only view of request

This commit is contained in:
Patrick Smith
2018-08-30 11:25:01 -04:00
parent 687ae30268
commit 4d6f51ed7f
2 changed files with 36 additions and 0 deletions

View File

@@ -119,6 +119,19 @@ def requests_submit(request_id=None):
return redirect("/requests?modal=pendingCCPOApproval")
@requests_bp.route("/requests/pending/<string:request_id>", methods=["GET"])
def view_pending_request(request_id=None):
request = Requests.get(request_id)
return render_template(
"requests/view_pending.html",
data=request.body,
service_branches=SERVICE_BRANCHES,
assistance_org_types=ASSISTANCE_ORG_TYPES,
data_transfer_amounts=DATA_TRANSFER_AMOUNTS,
completion_date_ranges=COMPLETION_DATE_RANGES,
)
# TODO: generalize this, along with other authorizations, into a policy-pattern
# for authorization in the application
def _check_can_view_request(request_id):