Opened 5 years ago
Last modified 4 years ago
#32137 closed Cleanup/optimization
Change message describing the deletion of inline objects in admin has no id available — at Initial Version
| 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
Sometimes the developer wishes the id to be a part of the Model.__str__.
Such model could of course be part of the inline model admin.
When the 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.
Note:
See TracTickets
for help on using tickets.