Ticket #9061: no_delete_formsets_extra.diff

File no_delete_formsets_extra.diff, 673 bytes (added by Gabriel Farrell, 11 years ago)

don't add delete field to formset extra forms

  • django/forms/formsets.py

     
    242242                form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), initial=index+1, required=False)
    243243            else:
    244244                form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), required=False)
    245         if self.can_delete:
     245        if self.can_delete and index < self._initial_form_count:
    246246            form.fields[DELETION_FIELD_NAME] = BooleanField(label=_(u'Delete'), required=False)
    247247
    248248    def add_prefix(self, index):
Back to Top