From 7a5d3451da46d100f65ce97720bcf8976ce6cc14 Mon Sep 17 00:00:00 2001 From: rma4ok Date: Fri, 22 May 2015 18:13:16 -0400 Subject: [PATCH] [fix] referencing obj variable --- flask_mongoengine/wtf/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flask_mongoengine/wtf/models.py b/flask_mongoengine/wtf/models.py index 086f4c1b..9a712688 100644 --- a/flask_mongoengine/wtf/models.py +++ b/flask_mongoengine/wtf/models.py @@ -4,12 +4,12 @@ class ModelForm(Form): """A WTForms mongoengine model form""" - def __init__(self, formdata=None, obj=None, prefix='', **kwargs): - self.instance = (kwargs.pop('instance', None) or kwargs.get('obj', None)) + def __init__(self, formdata=None, obj=None, **kwargs): + self.instance = (kwargs.pop('instance', None) or obj) if self.instance and not formdata: obj = self.instance self.formdata = formdata - super(ModelForm, self).__init__(formdata, obj, prefix, **kwargs) + super(ModelForm, self).__init__(formdata, obj, **kwargs) def save(self, commit=True, **kwargs): if self.instance: