Code

Opened 8 years ago

Closed 6 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.

Attachments (0)

Change History (3)

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

  • Cc jyrki.pulliainen@… added

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

  • Summary changed from Validators should not be run if core=True fields are empty when editing inline to Validators should not be run if core=True fields are empty when using edit_inline
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by brosner

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

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.