Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #21771 -- Made log_deletion consistent with other log methods.

Thanks Keryn Knight for the report.
  • Loading branch information...
commit 1b29d3289473a6c3ce565c0ddc1bed4d5b5ac9a3 1 parent f90be00
@alasdairnicol alasdairnicol authored timgraham committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/contrib/admin/options.py
View
6 django/contrib/admin/options.py
@@ -758,15 +758,15 @@ def log_change(self, request, object, message):
def log_deletion(self, request, object, object_repr):
"""
- Log that an object will be deleted. Note that this method is called
- before the deletion.
+ Log that an object will be deleted. Note that this method must be
+ called before the deletion.
The default implementation creates an admin LogEntry object.
"""
from django.contrib.admin.models import LogEntry, DELETION
LogEntry.objects.log_action(
user_id=request.user.pk,
- content_type_id=get_content_type_for_model(self.model).pk,
+ content_type_id=get_content_type_for_model(object).pk,
object_id=object.pk,
object_repr=object_repr,
action_flag=DELETION
Please sign in to comment.
Something went wrong with that request. Please try again.