Opened 4 weeks ago

Closed 3 weeks ago

#37092 closed Bug (fixed)

No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py

Reported by: Mike Edmunds Owned by: Jacob Walls
Component: Forms Version: dev
Severity: Release blocker Keywords:
Cc: Annabelle Wiegart 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

If the deprecated setting USE_BLANK_CHOICE_DASH is defined in settings.py, no deprecation warning is issued. (This setting was added in 63c56cda #35870 as immediately deprecated.)

The warning is only issued if USE_BLANK_CHOICE_DASH is defined via settings.configure() or override_settings().

I think the fix is to duplicate the warning from UserSettingHolder.__setattr__() into Settings.__init__(). (It needs to be in both places.)

Aside: Realistically testing django.conf.settings as if initialized from a settings module seems to be quite complicated right now. We might consider adding APIs to facilitate that testing, after 6.1 freezes.

Change History (5)

comment:1 by Jacob Walls, 4 weeks ago

Cc: Annabelle Wiegart added
Owner: set to Jacob Walls
Severity: NormalRelease blocker
Status: newassigned
Triage Stage: UnreviewedAccepted

Yep, this was next on my list, thanks for the report!

comment:2 by Annabelle Wiegart, 3 weeks ago

Sorry for my shortcoming! I was not aware of this.

comment:3 by Jacob Walls, 3 weeks ago

Has patch: set

No worries, Annabelle -- you were only following the example I gave you! (Lazy of me to give you a reversion commit and not actually dig up the fuller original implementation.)

PR following that original model, plus leveraging a utility that just landed in main.

comment:4 by Mike Edmunds, 3 weeks ago

Triage Stage: AcceptedReady for checkin

comment:5 by Jacob Walls <jacobtylerwalls@…>, 3 weeks ago

Resolution: fixed
Status: assignedclosed

In ed54863:

Fixed #37092, Refs #35870 -- Added missing deprecation warnings for USE_BLANK_CHOICE_DASH.

Follow-up to 63c56cda133a85a158502891c40465bc0331d3d9.

Modeled on 5d80843ebc5376d00f98bf2a6aadbada4c29365c.

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