Skip to content

Commit

Permalink
dont need to populate object here
Browse files Browse the repository at this point in the history
  • Loading branch information
Charl Joseph Mert committed Nov 20, 2018
1 parent db170e3 commit 92ad2c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion betterforms/multiform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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))
Expand Down

0 comments on commit 92ad2c6

Please sign in to comment.