Skip to content

Commit af4b255

Browse files
authored
Merge pull request #387 from sdayu/master
Fix formdata default value on ModelForm <-> FlaskForm inheritance.
2 parents c732d83 + 70376a7 commit af4b255

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flask_mongoengine/wtf/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from flask_wtf import FlaskForm
2+
from flask_wtf.form import _Auto
23

34

45
class ModelForm(FlaskForm):
56
"""A WTForms mongoengine model form"""
67

7-
def __init__(self, formdata=None, **kwargs):
8+
def __init__(self, formdata=_Auto, **kwargs):
89
self.instance = kwargs.pop("instance", None) or kwargs.get("obj")
910
if self.instance and not formdata:
1011
kwargs["obj"] = self.instance

0 commit comments

Comments
 (0)