We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e1a4c0c + f6feb97 commit 1fb7ddbCopy full SHA for 1fb7ddb
flask_mongoengine/wtf/orm.py
@@ -44,19 +44,11 @@ def __init__(self, converters=None):
44
self.converters = converters
45
46
def convert(self, model, field, field_args):
47
- validators = []
48
- try:
49
- if hasattr(field, 'validators') and\
50
- field.validators is not None:
51
- validators = field.validators
52
- except:
53
- pass
54
-
55
kwargs = {
56
'label': getattr(field, 'verbose_name', field.name),
57
'description': field.help_text or '',
58
- 'validators': validators,
59
- 'filters': [] if not field.filters else field.filters,
+ 'validators': getattr(field, 'validators', []),
+ 'filters': getattr(field, 'filters', []),
60
'default': field.default,
61
}
62
if field_args:
0 commit comments