Opened 6 years ago

Closed 5 years ago

#12003 closed (duplicate)

Admin application deltes related objects on "null=True" relation.

Reported by: x_O Owned by: nobody
Component: contrib.admin Version: 1.1
Severity: Keywords: admin delete remove related null True
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

We have two models

class First(db.models):
    second_item = models.ForeignKey('Second',null=True)
    ...

class  (db.models):
    ...

Both models registered in admin.py as AdminModels.

Trying to delete object created from "Second" class
which is RELATED to other one created from "First" class, admin tells that will remove also that "First" object. Important is that relation in
ForeignKey is null.

My interpretation of that "null=True" for admin.contrib: should set First objects with 'second_item' attribute = None.

Checked against 1.1.

Change History (1)

comment:1 Changed 5 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #10262, #7539

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