Opened 3 years ago

Closed 3 years ago

#20403 closed Bug (fixed)

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

Reported by: Carl Meyer Owned by: Ryan Kaskel
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


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 - I merely checked the "delete" checkbox without adding any new "uploads" or editing the existing ones)

Change History (3)

comment:1 Changed 3 years ago by Carl Meyer

Triage Stage: UnreviewedAccepted

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 3 years ago by Ryan Kaskel

Has patch: set
Owner: changed from nobody to Ryan Kaskel
Status: newassigned

I've opened this pull request to solve this.

Any feedback?

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

Resolution: fixed
Status: assignedclosed

In 4280217f31fc634d320b0cf30bcb6d582b19d784:

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

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