Ticket #10711: delete-via-cleaned-rather-than-raw.diff

File delete-via-cleaned-rather-than-raw.diff, 728 bytes (added by Brett Hoerner, 16 years ago)
  • django/forms/models.py

    diff --git a/django/forms/models.py b/django/forms/models.py
    index abdb83f..ac84758 100644
    a b class BaseModelFormSet(BaseFormSet):  
    413413             pk_value = form.fields[pk_name].clean(raw_pk_value)
    414414             obj = existing_objects[pk_value]
    415415             if self.can_delete:
    416                  raw_delete_value = form._raw_value(DELETION_FIELD_NAME)
    417                  should_delete = form.fields[DELETION_FIELD_NAME].clean(raw_delete_value)
     416                 should_delete = form.cleaned_data.get(DELETION_FIELD_NAME, False)
    418417                 if should_delete:
    419418                     self.deleted_objects.append(obj)
    420419                     obj.delete()
Back to Top