Skip to content

Commit

Permalink
Added a comment on how the strange code handling required came to be.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbr committed Jul 31, 2014
1 parent 2d284c8 commit 46b1661
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flask_bootstrap/templates/bootstrap/wtf.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
horizontal_columns=('lg', 2, 10),
button_map={}) %}

{# this is a workaround hack for the more straightforward-code of just passing required=required parameter. older versions of wtforms do not have
the necessary fix for required=False attributes, but will also not set the required flag in the first place. we skirt the issue using the code below #}
{% if field.flags.required and not required in kwargs %}
{% set kwargs = dict(required=True, **kwargs) %}
{% endif %}
Expand Down

0 comments on commit 46b1661

Please sign in to comment.