Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Adds the ability to force the UploadWidget to show no special options
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krienbühl committed Oct 8, 2015
1 parent 62df129 commit 182eb80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Changelog
Unreleased
~~~~~~~~~~

- Adds the ability to force the UploadWidget to show no special options.
[href]


0.7.2 (2015-10-05)
~~~~~~~~~~~~~~~~~~~

Expand Down
3 changes: 2 additions & 1 deletion onegov/form/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class UploadWidget(FileInput):
"""

def __call__(self, field, **kwargs):
force_simple = kwargs.pop('force_simple', False)
input_html = super(UploadWidget, self).__call__(field, **kwargs)

if not field.data:
if force_simple or not field.data:
return HTMLString(u"""
<div class="upload-widget without-data">
{}
Expand Down

0 comments on commit 182eb80

Please sign in to comment.