From a859af9eea50193a59e044c68f3a90cf8afb9037 Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Thu, 27 Sep 2018 18:14:24 -0400 Subject: [PATCH] Pass in request as `jedi_request` in request detail template Fixes the user sessions/daily traffic fields not being shown when they should be. --- atst/routes/requests/approval.py | 2 +- atst/routes/requests/requests_form.py | 2 +- templates/requests/_review.html | 2 +- templates/requests/approval.html | 12 ++++++------ templates/requests/details.html | 6 +++--- tests/routes/test_request_details.py | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/atst/routes/requests/approval.py b/atst/routes/requests/approval.py index 3d009bc8..41a6d6eb 100644 --- a/atst/routes/requests/approval.py +++ b/atst/routes/requests/approval.py @@ -35,7 +35,7 @@ def render_approval(request, form=None, internal_comment_form=None): "requests/approval.html", data=data, reviews=list(reversed(request.reviews)), - request=request, + jedi_request=request, current_status=request.status.value, review_form=form or CCPOReviewForm(), internal_comment_form=internal_comment_form, diff --git a/atst/routes/requests/requests_form.py b/atst/routes/requests/requests_form.py index 431b4828..1d7a4019 100644 --- a/atst/routes/requests/requests_form.py +++ b/atst/routes/requests/requests_form.py @@ -141,6 +141,6 @@ def view_request_details(request_id=None): return render_template( "requests/details.html", data=data, - request=request, + jedi_request=request, requires_fv_action=requires_fv_action, ) diff --git a/templates/requests/_review.html b/templates/requests/_review.html index 2bf0d665..c733a8f6 100644 --- a/templates/requests/_review.html +++ b/templates/requests/_review.html @@ -134,7 +134,7 @@ {{ DefinitionReviewField("DoD ID", "primary_poc", "dodid_poc") }} -{% if request.has_financial_data %} +{% if jedi_request.has_financial_data %}

Financial Verification diff --git a/templates/requests/approval.html b/templates/requests/approval.html index 3baa48c9..3aacf79e 100644 --- a/templates/requests/approval.html +++ b/templates/requests/approval.html @@ -17,14 +17,14 @@
-

Request: {{ request.displayname }} +

Request: {{ jedi_request.displayname }}

{{ current_status }}
- {% with data=data, request_id=request.id %} + {% with data=data, request_id=jedi_request.id %} {% include "requests/_review.html" %} {% endwith %} @@ -33,7 +33,7 @@
-
+

CCPO Internal Comments

@@ -82,7 +82,7 @@
- + {{ review_form.csrf_token }} @@ -139,7 +139,7 @@ {% endif %}
- {% if request.is_pending_ccpo_action %} + {% if jedi_request.is_pending_ccpo_action %}

Review this Request

@@ -226,7 +226,7 @@
- {% if request.is_pending_ccpo_action %} + {% if jedi_request.is_pending_ccpo_action %}
diff --git a/templates/requests/details.html b/templates/requests/details.html index a1199ffd..fed6c73b 100644 --- a/templates/requests/details.html +++ b/templates/requests/details.html @@ -5,9 +5,9 @@ {% block content %}
- {% if request.is_pending_ccpo_acceptance %} + {% if jedi_request.is_pending_ccpo_acceptance %} {{ Alert('Request submitted. Approval pending.', fragment="fragments/pending_ccpo_acceptance_alert.html") }} - {% elif request.is_pending_ccpo_approval %} + {% elif jedi_request.is_pending_ccpo_approval %} {{ Alert('Request submitted. Approval pending.', fragment="fragments/pending_ccpo_approval_modal.html") }} {% elif requires_fv_action %} {% include 'requests/review_menu.html' %} @@ -17,7 +17,7 @@

Request Details

-

{{ request.displayname }} {{ request.status_displayname }}

+

{{ jedi_request.displayname }} {{ jedi_request.status_displayname }}

diff --git a/tests/routes/test_request_details.py b/tests/routes/test_request_details.py index bd644182..eed48c53 100644 --- a/tests/routes/test_request_details.py +++ b/tests/routes/test_request_details.py @@ -19,7 +19,7 @@ def test_can_show_financial_data(client, user_session): ) body = response.data.decode() - assert re.search(">\s+Financial Verification\s+<", body) + assert re.search(r">\s+Financial Verification\s+<", body) def test_can_not_show_financial_data(client, user_session): @@ -34,4 +34,4 @@ def test_can_not_show_financial_data(client, user_session): ) body = response.data.decode() - assert not re.search(">\s+Financial Verification\s+<", body) + assert not re.search(r">\s+Financial Verification\s+<", body)