Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#36234 closed Bug (fixed)

Restore single_object argument to LogEntry.objects.log_actions()

Reported by: Adam Johnson Owned by: Adam Johnson
Component: contrib.admin Version: 5.1
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Natalia Bidart)

#36217 / 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:

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.

Change History (11)

comment:1 by Adam Johnson, 3 months ago

Description: modified (diff)

comment:2 by Simon Charette, 3 months ago

Triage Stage: UnreviewedAccepted

Accepted as I don't believe the signature breakage was considered when dropping single_object from it.

Last edited 3 months ago by Simon Charette (previous) (diff)

comment:3 by hesham hatem, 3 months ago

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?

comment:4 by Simon Charette, 3 months ago

Has patch: set
Owner: set to Adam Johnson
Status: newassigned

Thanks for the offer Hesham, but Adam already submitted a patch.

comment:5 by hesham hatem, 3 months ago

Thanks for the update, Simon! And great work, Adam, for submitting a patch. I’d love to contribute to other issues in the future

comment:6 by Sarah Boyce, 3 months ago

Needs documentation: set
Needs tests: set

comment:7 by Natalia Bidart, 3 months ago

Description: modified (diff)

comment:8 by Natalia Bidart, 3 months ago

Needs documentation: unset
Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:9 by nessita <124304+nessita@…>, 3 months ago

Resolution: fixed
Status: assignedclosed

In 27b68bca:

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+sarahboyce@…>

comment:10 by Natalia <124304+nessita@…>, 3 months ago

In 95031c1:

[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+sarahboyce@…>

Backport of 27b68bcadf1ab2e9f7fd223aed42db352ccdc62d from main.

comment:11 by Natalia <124304+nessita@…>, 3 months ago

In cfc33d1:

[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+sarahboyce@…>

Backport of 27b68bcadf1ab2e9f7fd223aed42db352ccdc62d from main.

Note: See TracTickets for help on using tickets.
Back to Top