Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#10698 closed (duplicate)

Admin code overwrites property of models in inlineformsets

Reported by: Matthias Kestenholz Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In InlineAdminForm, original is used to display the object that is being edited in an inline formset. To be able to redirect the user to the location given by original.get_absolute_url, the content type ID of original is determined and stored as an attribute on original. If original itself already had a content_type field however, the value of this field is overwritten. If original.content_object is accessed, and object of class original.class is returned (or None) instead of the correct type....

The attached patch does not really fix this behavior, because we still overwrite values on original, but admin_helpers_content_type_id is (much) less likely to be used than content_type_id

Attachments (1)

10698.patch (3.7 KB) - added by Matthias Kestenholz 11 years ago.

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Matthias Kestenholz

Attachment: 10698.patch added

comment:1 Changed 11 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 Changed 11 years ago by Matthias Kestenholz

Resolution: duplicate
Status: newclosed

Duplicate of #9362, fixed in [10667]

comment:3 Changed 9 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

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