Ticket #5758: non-deletable-formset-save.diff

File non-deletable-formset-save.diff, 684 bytes (added by Antti Kaihola, 17 years ago)

wouldn't testing for deletability implement the design more accurately?

  • django/newforms/models.py

     
    269269            # update/save existing instances
    270270            for form in self.change_forms:
    271271                instance = instances[form.cleaned_data[self.model._meta.pk.attname]]
    272                 if form.cleaned_data[DELETION_FIELD_NAME]:
     272                if self.deletable and form.cleaned_data[DELETION_FIELD_NAME]:
    273273                    instance.delete()
    274274                else:
    275275                    saved_instances.append(self.save_instance(form, instance, commit=commit))
Back to Top