Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#7790 closed (fixed)

New validator for ModelAdmin classes should use explicitly declared forms for validation if appropriate

Reported by: Rozza Owned by: brosner
Component: contrib.admin Version: newforms-admin
Severity: Keywords: nfa-blocker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Ticket #5374 Introduced automatic modeladmin validation if you have settings.DEBUG set to True - see r7929

However, this change doesn't handle customized forms for admin because it couples admin form fields 1-1 to the model.

The validator should check against any explicitly declared forms to ensure that the form is valid. Therefore allowing greater flexibility by allowing some decoupling from the model so that admin forms are customizable

Patch including tests attached

Attachments (1)

validation.py.patch (2.3 KB) - added by Rozza 7 years ago.
Patch to validation.py and added test cases to modeladmin/models.py

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Rozza

Patch to validation.py and added test cases to modeladmin/models.py

comment:1 Changed 7 years ago by anonymous

  • Keywords nfa-blocker added; BLOCKER newforms admin validation removed
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to anonymous
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by brosner

  • Owner changed from anonymous to brosner
  • Status changed from assigned to new

Whoops, that was me above.

comment:3 Changed 7 years ago by brosner

  • Status changed from new to assigned

comment:4 Changed 7 years ago by brosner

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

(In [7943]) newforms-admin: Fixed #7790 -- Check form fields, not model fields when testing for field existence in fields and fieldsets. Thanks Rozza for catching this and writing an initial patch.

post-commit mishap ;)

comment:5 Changed 3 years ago by jacob

  • milestone 1.0 alpha deleted

Milestone 1.0 alpha deleted

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