[Django] #36234: Restore single_object argument to LogEntry.objects.log_actions()

24 views
Skip to first unread message

Django

unread,
Mar 6, 2025, 11:29:05 AM3/6/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
------------------------------+-------------------------------------------
Reporter: Adam Johnson | Type: Bug
Status: new | Component: contrib.admin
Version: 5.1 | Severity: Release blocker
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-------------------------------------------
#36217 dropped the `single_argument` argument in a bug fix release
(5.1.7). Consequently, the method has two signatures in different Django
5.1 versions. I found real-world breakage from this in:

* a client project which had calls to `log_actions()`
* django-import-export - https://github.com/django-import-export/django-
import-export/pull/2045
* django-stubs - https://github.com/typeddjango/django-stubs/blob/master
/django-stubs/contrib/admin/models.pyi#L33 would need changing

I propose that we restore the argument in Django 5.1 and deprecate it from
Django 5.2. It doesn’t make sense that we’d go through the deprecation
pathway for the `log_action()` -> `log_actions()` migration, but drop an
argument in a point release.
--
Ticket URL: <https://code.djangoproject.com/ticket/36234>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 6, 2025, 11:30:54 AM3/6/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
---------------------------------+--------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Description changed by Adam Johnson:

Old description:

> #36217 dropped the `single_argument` argument in a bug fix release
> (5.1.7). Consequently, the method has two signatures in different Django
> 5.1 versions. I found real-world breakage from this in:
>
> * a client project which had calls to `log_actions()`
> * django-import-export - https://github.com/django-import-export/django-
> import-export/pull/2045
> * django-stubs - https://github.com/typeddjango/django-stubs/blob/master
> /django-stubs/contrib/admin/models.pyi#L33 would need changing
>
> I propose that we restore the argument in Django 5.1 and deprecate it
> from Django 5.2. It doesn’t make sense that we’d go through the
> deprecation pathway for the `log_action()` -> `log_actions()` migration,
> but drop an argument in a point release.

New description:

#36217 / [https://github.com/django/django/pull/19214/files#diff-
d146e5e5e0435a08eb6bf67f501b7b7dc4a28b3aa66caf47f48fe374d9732366L27-L29
this part of the PR] dropped the `single_argument` argument in a bug fix
release, 5.1.7. Consequently, the method has two signatures in different
Django 5.1 versions. I found real-world breakage from this in:

* a client project which had calls to `log_actions()`
* django-import-export - https://github.com/django-import-export/django-
import-export/pull/2045
* django-stubs - https://github.com/typeddjango/django-stubs/blob/master
/django-stubs/contrib/admin/models.pyi#L33 would need changing

I propose that we restore the argument in Django 5.1 and deprecate it from
Django 5.2. It doesn’t make sense that we’d go through the deprecation
pathway for the `log_action()` -> `log_actions()` migration, but drop an
argument in a point release.

--
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:1>

Django

unread,
Mar 6, 2025, 11:33:58 AM3/6/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
---------------------------------+------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Simon Charette):

* stage: Unreviewed => Accepted

Comment:

Accepted as I don't believe the signature breakage was considered when
dropping the `single_object`.
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:2>

Django

unread,
Mar 6, 2025, 3:01:21 PM3/6/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
---------------------------------+------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by hesham hatem):

I'd like to help with this issue. From what I understand, the
single_object argument was accidentally removed from
LogEntry.objects.log_actions() in Django 5.1.7, causing backward
compatibility issues. Since this was removed in a bug fix release without
going through the proper deprecation process, we need to restore it in
Django 5.1 and properly deprecate it in Django 5.2.

I can work on a patch that:

1. Restores the single_object parameter to maintain backward compatibility
2. Adds a deprecation warning when it's used
3. Updates the documentation to indicate this parameter is deprecated
Would this approach be correct? Is there anything else I should consider
when implementing this fix?
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:3>

Django

unread,
Mar 6, 2025, 3:46:49 PM3/6/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
---------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Changes (by Simon Charette):

* has_patch: 0 => 1
* owner: (none) => Adam Johnson
* status: new => assigned

Comment:

Thanks for the offer Hesham, but
[https://github.com/django/django/pull/19233 Adam already submitted a
patch].
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:4>

Django

unread,
Mar 6, 2025, 5:40:05 PM3/6/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
---------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Comment (by hesham hatem):

Thanks for the update, Simon! And great work, Adam, for submitting a
patch. I’d love to contribute to other issues in the future
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:5>

Django

unread,
Mar 7, 2025, 2:32:50 AM3/7/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
---------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Changes (by Sarah Boyce):

* needs_docs: 0 => 1
* needs_tests: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:6>

Django

unread,
Mar 7, 2025, 8:31:05 AM3/7/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
---------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Description changed by Natalia Bidart:

Old description:

> #36217 / [https://github.com/django/django/pull/19214/files#diff-
> d146e5e5e0435a08eb6bf67f501b7b7dc4a28b3aa66caf47f48fe374d9732366L27-L29
> this part of the PR] dropped the `single_argument` argument in a bug fix
> release, 5.1.7. Consequently, the method has two signatures in different
> Django 5.1 versions. I found real-world breakage from this in:
>
> * a client project which had calls to `log_actions()`
> * django-import-export - https://github.com/django-import-export/django-
> import-export/pull/2045
> * django-stubs - https://github.com/typeddjango/django-stubs/blob/master
> /django-stubs/contrib/admin/models.pyi#L33 would need changing
>
> I propose that we restore the argument in Django 5.1 and deprecate it
> from Django 5.2. It doesn’t make sense that we’d go through the
> deprecation pathway for the `log_action()` -> `log_actions()` migration,
> but drop an argument in a point release.

New description:

#36217 / [https://github.com/django/django/pull/19214/files#diff-
d146e5e5e0435a08eb6bf67f501b7b7dc4a28b3aa66caf47f48fe374d9732366L27-L29
this part of the PR] dropped the `single_object` argument in a bug fix
release, 5.1.7. Consequently, the method has two signatures in different
Django 5.1 versions. I found real-world breakage from this in:

* a client project which had calls to `log_actions()`
* django-import-export - https://github.com/django-import-export/django-
import-export/pull/2045
* django-stubs - https://github.com/typeddjango/django-stubs/blob/master
/django-stubs/contrib/admin/models.pyi#L33 would need changing

I propose that we restore the argument in Django 5.1 and deprecate it from
Django 5.2. It doesn’t make sense that we’d go through the deprecation
pathway for the `log_action()` -> `log_actions()` migration, but drop an
argument in a point release.

--
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:7>

Django

unread,
Mar 12, 2025, 3:23:13 PM3/12/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* needs_docs: 1 => 0
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:8>

Django

unread,
Mar 12, 2025, 3:25:41 PM3/12/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by nessita <124304+nessita@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"27b68bcadf1ab2e9f7fd223aed42db352ccdc62d" 27b68bca]:
{{{#!CommitTicketReference repository=""
revision="27b68bcadf1ab2e9f7fd223aed42db352ccdc62d"
Fixed #36234 -- Restored single_object argument to
LogEntry.objects.log_actions().

Thank you Adam Johnson for the report and fix. Thank you Sarah Boyce for
your spot on analysis.

Regression in c09bceef68e5abb79accedd12dade16aa6577a09, which is
partially reverted in this branch.

Co-authored-by: Sarah Boyce <42296566+...@users.noreply.github.com>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:9>

Django

unread,
Mar 12, 2025, 3:38:32 PM3/12/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):

In [changeset:"95031c1ab1e67c2d77562a0cbce974e6ec439536" 95031c1]:
{{{#!CommitTicketReference repository=""
revision="95031c1ab1e67c2d77562a0cbce974e6ec439536"
[5.2.x] Fixed #36234 -- Restored single_object argument to
LogEntry.objects.log_actions().

Thank you Adam Johnson for the report and fix. Thank you Sarah Boyce for
your spot on analysis.

Regression in c09bceef68e5abb79accedd12dade16aa6577a09, which is
partially reverted in this branch.

Co-authored-by: Sarah Boyce <42296566+...@users.noreply.github.com>

Backport of 27b68bcadf1ab2e9f7fd223aed42db352ccdc62d from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:10>

Django

unread,
Mar 12, 2025, 3:40:24 PM3/12/25
to django-...@googlegroups.com
#36234: Restore single_object argument to LogEntry.objects.log_actions()
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):

In [changeset:"cfc33d146e1085909fe3c13b0fec8df955cd4272" cfc33d1]:
{{{#!CommitTicketReference repository=""
revision="cfc33d146e1085909fe3c13b0fec8df955cd4272"
[5.1.x] Fixed #36234 -- Restored single_object argument to
LogEntry.objects.log_actions().

Thank you Adam Johnson for the report and fix. Thank you Sarah Boyce for
your spot on analysis.

Regression in c09bceef68e5abb79accedd12dade16aa6577a09, which is
partially reverted in this branch.

Co-authored-by: Sarah Boyce <42296566+...@users.noreply.github.com>

Backport of 27b68bcadf1ab2e9f7fd223aed42db352ccdc62d from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36234#comment:11>
Reply all
Reply to author
Forward
0 new messages