summaryrefslogtreecommitdiff
path: root/django/newforms
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-11-06 02:38:12 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-11-06 02:38:12 +0000
commit99e8171a610389e295a83b6f69b4e4d442984a2f (patch)
treec76b04154aab4a8d032af47cf521830dae11d038 /django/newforms
parent94954862d5e6c03b66aaa9775e44fa1d0c05e20f (diff)
newforms-admin: Fixed #5758 -- Added a check to ensure that an inline 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
Diffstat (limited to 'django/newforms')
-rw-r--r--django/newforms/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/newforms/models.py b/django/newforms/models.py
index 5fdbc4d959..31ed13c2b6 100644
--- a/django/newforms/models.py
+++ b/django/newforms/models.py
@@ -269,7 +269,7 @@ class BaseModelFormSet(BaseFormSet):
# 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))