Opened 3 weeks ago

Closed 3 days ago

Last modified 3 days ago

#37190 closed Bug (fixed)

Deprecation warning for action_location parameter should mention subclass and/or point to user code

Reported by: Jacob Walls Owned by: Mike Edmunds
Component: contrib.admin Version: 6.1
Severity: Release blocker Keywords:
Cc: Mike Edmunds, Marcelo Galigniana 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

As pointed out in #37187, we have deprecation warnings being emitted on wsgiref frames for the deprecation warning added in #12090:

/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/wsgiref/handlers.py:137: RemovedInDjango70Warning: Overriding get_action_choices() without the 'action_location' parameter is deprecated. Update the signature to get_action_choices(self, request, default_choices=None, action_location=ActionLocation.CHANGE_LIST).

Analysis from #37187:

... trying to warn about an overridden subclass method that has already been called so is no longer on the stack.

Change History (9)

comment:1 by Jacob Walls, 3 weeks ago

Summary: Deprecation warning for action_location parameter should warn about external use instead of skipping Django framesDeprecation warning for action_location parameter should mention subclass and not skip Django frames

comment:2 by Jacob Walls, 3 weeks ago

Summary: Deprecation warning for action_location parameter should mention subclass and not skip Django framesDeprecation warning for action_location parameter should mention subclass and/or point to user code

comment:3 by Mike Edmunds, 3 weeks ago

Owner: set to Mike Edmunds
Status: newassigned

comment:4 by Mike Edmunds, 3 weeks ago

The new warnings.warn_explicit() helper being proposed for #37187 could also cover this.

comment:6 by David Smith, 3 weeks ago

Triage Stage: UnreviewedAccepted

comment:7 by Jacob Walls, 3 days ago

Triage Stage: AcceptedReady for checkin

comment:8 by Jacob Walls <jacobtylerwalls@…>, 3 days ago

Resolution: fixed
Status: assignedclosed

In 2e48636c:

Fixed #37187, #37190 -- Pointed ModelAdmin warnings to the deprecated code.

Used warn_about_implementation() for ModelAdmin deprecation warnings on
get_list_select_related() return value and missing action_location
parameters in get_actions() and get_action_choices(). Fixes a problem
where the warnings would point to wsgiref rather than the ModelAdmin
subclass using deprecated functionality.

comment:9 by Jacob Walls <jacobtylerwalls@…>, 3 days ago

In bc529fb8:

[6.1.x] Fixed #37187, #37190 -- Pointed ModelAdmin warnings to the deprecated code.

Used warn_about_implementation() for ModelAdmin deprecation warnings on
get_list_select_related() return value and missing action_location
parameters in get_actions() and get_action_choices(). Fixes a problem
where the warnings would point to wsgiref rather than the ModelAdmin
subclass using deprecated functionality.

Backport of 2e48636c54910e435eb31e1b7d8a8089c84233ad from main.

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