Opened 10 years ago

Closed 8 years ago

#3043 closed defect (fixed)

Validators should not be run if core=True fields are empty when using edit_inline

Reported by: Jyrki Pulliainen <jyrki.pulliainen@…> Owned by: nobody
Component: contrib.admin Version: master
Severity: normal Keywords:
Cc: jyrki.pulliainen@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

An example class for demonstration:

class Foo(models.Model):
    field1 = models.TextField(validator_list=[RequiredIfOtherFieldNotGiven('field2')])
    field2 = models.TextField()
    filed3 = models.TextField(core=True)
    relates = models.ForeignKey(SomeGreaterModel, edit_inline=models.STACKED)

In this case, if object of class Foo is edited inline in SomeGreaterModel, it cannot be deleted since if field1, field2 and field3 are empty, the validator does not validate and it wont let you to save SomeGreaterModel instance.

Change History (3)

comment:1 Changed 10 years ago by Jyrki Pulliainen <jyrki.pulliainen@…>

Cc: jyrki.pulliainen@… added

comment:2 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Summary: Validators should not be run if core=True fields are empty when editing inlineValidators should not be run if core=True fields are empty when using edit_inline
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Brian Rosner

Resolution: fixed
Status: newclosed

oldforms is going away and is no longer supported. core=True is also no longer used in the admin since the merge of newforms-admin in [7967]. Therefore this has been effectively fixed.

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