Wrong comment in django.contrib.admin.options log_deletion
|Reported by:||Anssi Kääriäinen||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Comment of django.contrib.admin.options log_deletion says:
Log that an object has been successfully deleted. Note that since the object is deleted, it might no longer be safe to call *any* methods on the object, hence this method getting object_repr.
However this function is called before the object is deleted (from admin.actions delete_selected() and admin.options delete_view().
The changeset that changed the order of obj.delete() and log_deletion() is r10686 fixing the issue reported in #10889. The reason for the change is that log_deletion needs the pk of the object, but this is set to none when obj.delete() is called.
The comment should probably mention that this function is called before deletion, as opposed to log_change and log_addition.