Require portfolio id in upload-token

It's necessary for the authz decorator
This commit is contained in:
richard-dds
2019-08-28 11:59:11 -04:00
parent 0566b525f6
commit 67a4bb602d
5 changed files with 28 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
{% from "components/icon.html" import Icon %}
{% macro UploadInput(field, show_label=False, watch=False, token="", object_name="") -%}
{% macro UploadInput(field, portfolio_id, show_label=False, watch=False, token="", object_name="") -%}
<uploadinput
inline-template
{% if not field.errors %}
@@ -9,6 +9,7 @@
v-bind:initial-errors='true'
{% endif %}
v-bind:watch='{{ watch | string | lower }}'
v-bind:portfolio-id="'{{ portfolio_id }}'"
name='{{ field.name }}'
:optional='false'
>

View File

@@ -14,8 +14,7 @@
{% set next_button_text = "Next: Add TO Number" %}
{% set step = "1" %}
{% block to_builder_form_field %}
{{ TOFormStepHeader('task_orders.form.supporting_docs_header' | translate, 'task_orders.form.supporting_docs_text' | translate) }}
{{ UploadInput(form.pdf, watch=True, token=token, object_name=object_name) }}
{{ UploadInput(form.pdf, portfolio.id, watch=True, token=token, object_name=object_name) }}
{% endblock %}