mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #34462 -- Made admin log actions in bulk.
This also deprecates ModelAdmin.log_deletion() and LogEntryManager.log_action().
This commit is contained in:
committed by
Mariusz Felisiak
parent
45e0c5892f
commit
40b3975e7d
@@ -3808,33 +3808,27 @@ class AdminViewStringPrimaryKeyTest(TestCase):
|
||||
r"""-_.!~*'() ;/?:@&=+$, <>#%" {}|\^[]`"""
|
||||
)
|
||||
cls.m1 = ModelWithStringPrimaryKey.objects.create(string_pk=cls.pk)
|
||||
content_type_pk = ContentType.objects.get_for_model(
|
||||
ModelWithStringPrimaryKey
|
||||
).pk
|
||||
user_pk = cls.superuser.pk
|
||||
LogEntry.objects.log_action(
|
||||
LogEntry.objects.log_actions(
|
||||
user_pk,
|
||||
content_type_pk,
|
||||
cls.pk,
|
||||
cls.pk,
|
||||
[cls.m1],
|
||||
2,
|
||||
change_message="Changed something",
|
||||
single_object=True,
|
||||
)
|
||||
LogEntry.objects.log_action(
|
||||
LogEntry.objects.log_actions(
|
||||
user_pk,
|
||||
content_type_pk,
|
||||
cls.pk,
|
||||
cls.pk,
|
||||
[cls.m1],
|
||||
1,
|
||||
change_message="Added something",
|
||||
single_object=True,
|
||||
)
|
||||
LogEntry.objects.log_action(
|
||||
LogEntry.objects.log_actions(
|
||||
user_pk,
|
||||
content_type_pk,
|
||||
cls.pk,
|
||||
cls.pk,
|
||||
[cls.m1],
|
||||
3,
|
||||
change_message="Deleted something",
|
||||
single_object=True,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user