Skip to content

Commit

Permalink
newforms-admin: Fixed #5758 -- Added a check to ensure that an inline…
Browse files Browse the repository at this point in the history
… model formset is actually deletable before checking the deletion field. Thanks, Brian Rosner and akaihola.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6654 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Nov 6, 2007
1 parent 9495486 commit 99e8171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/newforms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def save(self, commit=True):
# update/save existing instances
for form in self.change_forms:
instance = instances[form.cleaned_data[self.model._meta.pk.attname]]
if form.cleaned_data[DELETION_FIELD_NAME]:
if self.deletable and form.cleaned_data[DELETION_FIELD_NAME]:
instance.delete()
else:
saved_instances.append(self.save_instance(form, instance, commit=commit))
Expand Down

0 comments on commit 99e8171

Please sign in to comment.