Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10698 closed (duplicate)

Admin code overwrites property of models in inlineformsets

Reported by: mk 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: UI/UX:

Description

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 mk 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by mk

comment:1 Changed 5 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by mk

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

Duplicate of #9362, fixed in [10667]

comment:3 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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.