Commit 22853154 authored by Serge S. Koval's avatar Serge S. Koval

Always use multipart/form-data for all forms. Allows using file fields in inline forms

parent e06d55d3
......@@ -24,6 +24,7 @@ class BaseForm(wtf.Form):
def has_file_field(self):
"""
Return True if form contains at least one FileField.
Does not check for child form fields.
"""
# TODO: Optimize me
for f in self:
......
......@@ -114,7 +114,7 @@
{% endmacro %}
{% macro form_tag() %}
<form action="" method="POST" class="form-horizontal"{% if form.has_file_field %} enctype="multipart/form-data"{% endif %}>
<form action="" method="POST" class="form-horizontal" enctype="multipart/form-data">
<fieldset>
{{ caller() }}
</fieldset>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment