Opened 2 years ago

Closed 2 years ago

#20403 closed Bug (fixed)

Cannot remove records from a formset that exceeds max_num (with validate_max)

Reported by: carljm Owned by: ryankask
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Originally reported by "yoyoma" in #20333:

When validate_max is in effect, but max_num has already been exceeded (i.e., if I turn down max_num after users create objects) Django doesn't allow the user to even delete the existing records, meaning there is no way to remedy the situation. (see http://cl.ly/image/1k1Z1j2L2J3f - I merely checked the "delete" checkbox without adding any new "uploads" or editing the existing ones)

Change History (3)

comment:1 Changed 2 years ago by carljm

  • Triage Stage changed from Unreviewed to Accepted

I think for a formset with can_delete=True, it would be reasonable for the max-validation to exclude rows-to-be-deleted.

comment:2 Changed 2 years ago by ryankask

  • Has patch set
  • Owner changed from nobody to ryankask
  • Status changed from new to assigned

I've opened this pull request to solve this.

Any feedback?

comment:3 Changed 2 years ago by Carl Meyer <carl@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 4280217f31fc634d320b0cf30bcb6d582b19d784:

Fixed #20403 -- Ignore forms marked for deletion when validating max_num.

Note: See TracTickets for help on using tickets.
Back to Top