diff options
| author | antoliny0919 <antoliny0919@gmail.com> | 2025-02-28 20:17:17 +0900 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-03-04 10:34:15 +0100 |
| commit | c09bceef68e5abb79accedd12dade16aa6577a09 (patch) | |
| tree | 6f0d89f6b5d517550ba10fd4002e4dc783118337 /django | |
| parent | 1759c1dbd1e3cd4c9fcd345269e0d25796468f7f (diff) | |
Fixed #36217 -- Restored pre_save/post_save signal emission via LogEntry.save() for single-object deletion in the admin.
Regression in 40b3975e7d3e1464a733c69171ad7d38f8814280.
Thanks smiling-watermelon for the report.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/models.py | 6 | ||||
| -rw-r--r-- | django/contrib/admin/options.py | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/django/contrib/admin/models.py b/django/contrib/admin/models.py index 5723ebff7f..453e65cf01 100644 --- a/django/contrib/admin/models.py +++ b/django/contrib/admin/models.py @@ -24,9 +24,7 @@ ACTION_FLAG_CHOICES = [ class LogEntryManager(models.Manager): use_in_migrations = True - def log_actions( - self, user_id, queryset, action_flag, change_message="", *, single_object=False - ): + def log_actions(self, user_id, queryset, action_flag, change_message=""): if isinstance(change_message, list): change_message = json.dumps(change_message) @@ -44,7 +42,7 @@ class LogEntryManager(models.Manager): for obj in queryset ] - if single_object and log_entry_list: + if len(log_entry_list) == 1: instance = log_entry_list[0] instance.save() return instance diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 3c2cf9d130..090b12151a 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -946,7 +946,6 @@ class ModelAdmin(BaseModelAdmin): queryset=[obj], action_flag=ADDITION, change_message=message, - single_object=True, ) def log_change(self, request, obj, message): @@ -962,7 +961,6 @@ class ModelAdmin(BaseModelAdmin): queryset=[obj], action_flag=CHANGE, change_message=message, - single_object=True, ) def log_deletions(self, request, queryset): |
