Skip to content

Commit 91d42c1

Browse files
committed
Fix regressions introduced by Flask-WTF v0.14.
Fixes #294.
1 parent e89cec0 commit 91d42c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

flask_mongoengine/wtf/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
class ModelForm(FlaskForm):
55
"""A WTForms mongoengine model form"""
66

7-
def __init__(self, formdata=None, obj=None, **kwargs):
8-
self.instance = (kwargs.pop('instance', None) or obj)
7+
def __init__(self, formdata=None, **kwargs):
8+
self.instance = (kwargs.pop('instance', None) or kwargs.get('obj'))
99
if self.instance and not formdata:
10-
obj = self.instance
10+
kwargs['obj'] = self.instance
1111
self.formdata = formdata
12-
super(ModelForm, self).__init__(formdata, obj, **kwargs)
12+
super(ModelForm, self).__init__(formdata, **kwargs)
1313

1414
def save(self, commit=True, **kwargs):
1515
if self.instance:

0 commit comments

Comments
 (0)