Admin code overwrites property of models in inlineformsets
|Reported by:||Matthias Kestenholz||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||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