Pass in request as jedi_request in request detail template

Fixes the user sessions/daily traffic fields not being shown when they
should be.
This commit is contained in:
Patrick Smith 2018-09-27 18:14:24 -04:00
parent 9f4663a8d5
commit a859af9eea
6 changed files with 14 additions and 14 deletions

View File

@ -35,7 +35,7 @@ def render_approval(request, form=None, internal_comment_form=None):
"requests/approval.html", "requests/approval.html",
data=data, data=data,
reviews=list(reversed(request.reviews)), reviews=list(reversed(request.reviews)),
request=request, jedi_request=request,
current_status=request.status.value, current_status=request.status.value,
review_form=form or CCPOReviewForm(), review_form=form or CCPOReviewForm(),
internal_comment_form=internal_comment_form, internal_comment_form=internal_comment_form,

View File

@ -141,6 +141,6 @@ def view_request_details(request_id=None):
return render_template( return render_template(
"requests/details.html", "requests/details.html",
data=data, data=data,
request=request, jedi_request=request,
requires_fv_action=requires_fv_action, requires_fv_action=requires_fv_action,
) )

View File

@ -134,7 +134,7 @@
{{ DefinitionReviewField("DoD ID", "primary_poc", "dodid_poc") }} {{ DefinitionReviewField("DoD ID", "primary_poc", "dodid_poc") }}
</dl> </dl>
{% if request.has_financial_data %} {% if jedi_request.has_financial_data %}
<hr> <hr>
<h2> <h2>
Financial Verification Financial Verification

View File

@ -17,14 +17,14 @@
<section class='panel'> <section class='panel'>
<header class='panel__heading panel__heading--divider request-approval__heading'> <header class='panel__heading panel__heading--divider request-approval__heading'>
<h1 class='h2'>Request: {{ request.displayname }} <h1 class='h2'>Request: {{ jedi_request.displayname }}
</h1> </h1>
<span class='label label--info'>{{ current_status }}</span> <span class='label label--info'>{{ current_status }}</span>
</header> </header>
<div class='panel__content'> <div class='panel__content'>
{% with data=data, request_id=request.id %} {% with data=data, request_id=jedi_request.id %}
{% include "requests/_review.html" %} {% include "requests/_review.html" %}
{% endwith %} {% endwith %}
@ -33,7 +33,7 @@
</section> </section>
<section class='internal-notes' id='ccpo-notes'> <section class='internal-notes' id='ccpo-notes'>
<form method="POST" action="{{ url_for('requests.create_internal_comment', request_id=request.id) }}"> <form method="POST" action="{{ url_for('requests.create_internal_comment', request_id=jedi_request.id) }}">
<div class='panel'> <div class='panel'>
<div class='panel__heading panel__heading--divider'> <div class='panel__heading panel__heading--divider'>
<h2>CCPO Internal Comments</h2> <h2>CCPO Internal Comments</h2>
@ -82,7 +82,7 @@
<section class='request-approval__review'> <section class='request-approval__review'>
<form method="POST" action="{{ url_for("requests.submit_approval", request_id=request.id) }}" autocomplete="off"> <form method="POST" action="{{ url_for("requests.submit_approval", request_id=jedi_request.id) }}" autocomplete="off">
{{ review_form.csrf_token }} {{ review_form.csrf_token }}
<ccpo-approval inline-template> <ccpo-approval inline-template>
@ -139,7 +139,7 @@
{% endif %} {% endif %}
</div> </div>
{% if request.is_pending_ccpo_action %} {% if jedi_request.is_pending_ccpo_action %}
<div class='panel__heading request-approval__review__heading'> <div class='panel__heading request-approval__review__heading'>
<h3 class='h3'>Review this Request</h2> <h3 class='h3'>Review this Request</h2>
</div> </div>
@ -226,7 +226,7 @@
</div> </div>
{% if request.is_pending_ccpo_action %} {% if jedi_request.is_pending_ccpo_action %}
<div v-if='approving || denying' class='action-group' v-cloak> <div v-if='approving || denying' class='action-group' v-cloak>
<button v-if='approving' type="submit" name="approved" class='usa-button usa-button-big'>Approve Request</button> <button v-if='approving' type="submit" name="approved" class='usa-button usa-button-big'>Approve Request</button>
<button v-if='denying' type="submit" name="denied" class='usa-button usa-button-big'>Request Revisions</button> <button v-if='denying' type="submit" name="denied" class='usa-button usa-button-big'>Request Revisions</button>

View File

@ -5,9 +5,9 @@
{% block content %} {% block content %}
<div class="col"> <div class="col">
{% 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") }} {{ 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") }} {{ Alert('Request submitted. Approval pending.', fragment="fragments/pending_ccpo_approval_modal.html") }}
{% elif requires_fv_action %} {% elif requires_fv_action %}
{% include 'requests/review_menu.html' %} {% include 'requests/review_menu.html' %}
@ -17,7 +17,7 @@
<div class="panel"> <div class="panel">
<div class="panel__heading"> <div class="panel__heading">
<h1>Request Details</h1> <h1>Request Details</h1>
<h2><span class="subtitle">{{ request.displayname }}</span> <span class="label label--info">{{ request.status_displayname }}</span></h2> <h2><span class="subtitle">{{ jedi_request.displayname }}</span> <span class="label label--info">{{ jedi_request.status_displayname }}</span></h2>
</div> </div>
<div class="panel__content"> <div class="panel__content">

View File

@ -19,7 +19,7 @@ def test_can_show_financial_data(client, user_session):
) )
body = response.data.decode() 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): 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() body = response.data.decode()
assert not re.search(">\s+Financial Verification\s+<", body) assert not re.search(r">\s+Financial Verification\s+<", body)