Fixed #21771 -- Made log_deletion consistent with other log methods.
Thanks Keryn Knight for the report.
This commit is contained in:
parent
f90be002d9
commit
1b29d32894
|
@ -758,15 +758,15 @@ class ModelAdmin(BaseModelAdmin):
|
||||||
|
|
||||||
def log_deletion(self, request, object, object_repr):
|
def log_deletion(self, request, object, object_repr):
|
||||||
"""
|
"""
|
||||||
Log that an object will be deleted. Note that this method is called
|
Log that an object will be deleted. Note that this method must be
|
||||||
before the deletion.
|
called before the deletion.
|
||||||
|
|
||||||
The default implementation creates an admin LogEntry object.
|
The default implementation creates an admin LogEntry object.
|
||||||
"""
|
"""
|
||||||
from django.contrib.admin.models import LogEntry, DELETION
|
from django.contrib.admin.models import LogEntry, DELETION
|
||||||
LogEntry.objects.log_action(
|
LogEntry.objects.log_action(
|
||||||
user_id=request.user.pk,
|
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_id=object.pk,
|
||||||
object_repr=object_repr,
|
object_repr=object_repr,
|
||||||
action_flag=DELETION
|
action_flag=DELETION
|
||||||
|
|
Loading…
Reference in New Issue