Opened 4 years ago

Last modified 2 years ago

#32137 closed Cleanup/optimization

Change message describing the deletion of inline objects in admin has no id available — at Version 1

Reported by: Vlada Macek Owned by: nobody
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Richard Laager Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Vlada Macek)

Sometimes the developer wishes the id to be a part of the Model.__str__.
Such model could of course be as inline in other model admin.
When such inline object is deleted, the save_related() of the formset deletes it just before the first call of construct_change_message() in https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1586 chimes in.

At that moment, the id is None and "None" makes it to the "Deleted ..." LogEntry.change_message for the formset.

Change History (1)

comment:1 by Vlada Macek, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top