Opened 6 hours ago
Last modified 93 minutes ago
#36234 assigned Bug
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: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
#36217 / 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.
Change History (4)
comment:1 by , 6 hours ago
Description: | modified (diff) |
---|
comment:2 by , 6 hours ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 2 hours 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:
- Restores the single_object parameter to maintain backward compatibility
- Adds a deprecation warning when it's used
- 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 , 93 minutes ago
Has patch: | set |
---|---|
Owner: | set to |
Status: | new → assigned |
Thanks for the offer Hesham, but Adam already submitted a patch.
Accepted as I don't believe the signature breakage was considered when dropping the
single_object
.