From 92ad2c65b24e30b144fe0658c49faf5f81be1395 Mon Sep 17 00:00:00 2001 From: Charl Joseph Mert Date: Tue, 20 Nov 2018 15:41:24 +0200 Subject: [PATCH] dont need to populate object here --- betterforms/multiform.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/betterforms/multiform.py b/betterforms/multiform.py index ad92773..e4f8613 100644 --- a/betterforms/multiform.py +++ b/betterforms/multiform.py @@ -330,7 +330,6 @@ def fields(self): def get_form_args_kwargs(self, key, args, kwargs): fargs, fkwargs = super(MultiModelForm, self).get_form_args_kwargs(key, args, kwargs) - self.object = self.get_proxy_model(self.get_objects(pk=1)) if hasattr(self, 'object'): kwargs.update({'instance': self.object}) @@ -342,6 +341,8 @@ def save(self, commit=True): (key, form.save(commit)) for key, form in self.formsPopulated ) + elif (len(self.objects) > 0): + objects = self.objects else: objects = OrderedDict( (key, form.save(commit))