summaryrefslogtreecommitdiffstats
path: root/utils/widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/widgets.py')
-rw-r--r--utils/widgets.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/widgets.py b/utils/widgets.py
index 3b65b82..4ce206f 100644
--- a/utils/widgets.py
+++ b/utils/widgets.py
@@ -20,3 +20,15 @@ class TextArea(wtforms.widgets.core.TextArea):
if arg not in kwargs:
kwargs[arg] = self.kwargs[arg]
return super(TextArea, self).__call__(field, **kwargs)
+
+
+class PasswordInput(wtforms.widgets.core.PasswordInput):
+ def __init__(self, hide_value=True, **kwargs):
+ self.kwargs = kwargs
+ super(PasswordInput, self).__init__(hide_value)
+
+ def __call__(self, field, **kwargs):
+ for arg in self.kwargs:
+ if arg not in kwargs:
+ kwargs[arg] = self.kwargs[arg]
+ return super(PasswordInput, self).__call__(field, **kwargs)