Skip to content

Commit 68ccb1e

Browse files
committed
Merge pull request #151 from rma4ok/fix-form-params
[fix] referencing obj variable
2 parents 92d7c74 + 7a5d345 commit 68ccb1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

flask_mongoengine/wtf/models.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
class ModelForm(Form):
55
"""A WTForms mongoengine model form"""
66

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

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

0 commit comments

Comments
 (0)