Handle uploaded file in task order route

This commit is contained in:
Patrick Smith 2019-01-21 15:53:54 -05:00
parent 4a377007f6
commit ebf063f245
2 changed files with 4 additions and 3 deletions

View File

@ -272,8 +272,9 @@ def new(screen, task_order_id=None, portfolio_id=None):
"/portfolios/<portfolio_id>/task_orders/new/<int:screen>", methods=["POST"]
)
def update(screen, task_order_id=None, portfolio_id=None):
form_data = {**http_request.form, **http_request.files}
workflow = UpdateTaskOrderWorkflow(
g.current_user, http_request.form, screen, task_order_id, portfolio_id
g.current_user, form_data, screen, task_order_id, portfolio_id
)
if workflow.validate():

View File

@ -10,9 +10,9 @@
{% block form_action %}
{% if task_order_id %}
<form method='POST' action="{{ url_for('task_orders.new', screen=current, task_order_id=task_order_id) }}" autocomplete="off">
<form method='POST' action="{{ url_for('task_orders.new', screen=current, task_order_id=task_order_id) }}" autocomplete="off" enctype="multipart/form-data">
{% else %}
<form method='POST' action="{{ url_for('task_orders.update', screen=current, portfolio_id=portfolio_id) }}" autocomplete="off">
<form method='POST' action="{{ url_for('task_orders.update', screen=current, portfolio_id=portfolio_id) }}" autocomplete="off" enctype="multipart/form-data">
{% endif %}
{% endblock %}