[Django] #37092: No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py

19 views
Skip to first unread message

Django

unread,
May 8, 2026, 5:48:22 PMMay 8
to django-...@googlegroups.com
#37092: No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py
------------------------------+--------------------------------------
Reporter: Mike Edmunds | Type: Bug
Status: new | Component: Forms
Version: dev | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
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
[https://github.com/medmunds/django/blob/e7ba310fa262786ca7ce235da588b27312c7a855/tests/mail/test_deprecated.py#L172-L208
quite complicated] right now. We might consider adding APIs to facilitate
that testing, after 6.1 freezes.
--
Ticket URL: <https://code.djangoproject.com/ticket/37092>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 8, 2026, 7:50:02 PMMay 8
to django-...@googlegroups.com
#37092: No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py
---------------------------------+---------------------------------------
Reporter: Mike Edmunds | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: Forms | Version: dev
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 Jacob Walls):

* cc: Annabelle Wiegart (added)
* owner: (none) => Jacob Walls
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
* status: new => assigned

Comment:

Yep, this was next on my list, thanks for the report!
--
Ticket URL: <https://code.djangoproject.com/ticket/37092#comment:1>

Django

unread,
May 11, 2026, 10:43:09 AMMay 11
to django-...@googlegroups.com
#37092: No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py
---------------------------------+---------------------------------------
Reporter: Mike Edmunds | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: Forms | Version: dev
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 Annabelle Wiegart):

Sorry for my shortcoming! I was not aware of this.
--
Ticket URL: <https://code.djangoproject.com/ticket/37092#comment:2>

Django

unread,
May 13, 2026, 5:23:09 PMMay 13
to django-...@googlegroups.com
#37092: No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py
---------------------------------+---------------------------------------
Reporter: Mike Edmunds | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: Forms | Version: dev
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 Jacob Walls):

* has_patch: 0 => 1

Comment:

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.)

[https://github.com/django/django/pull/21285 PR] following that original
model, plus leveraging a utility that just landed in main.
--
Ticket URL: <https://code.djangoproject.com/ticket/37092#comment:3>

Django

unread,
May 13, 2026, 6:34:56 PMMay 13
to django-...@googlegroups.com
#37092: No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py
-------------------------------------+-------------------------------------
Reporter: Mike Edmunds | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: Forms | Version: dev
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 Mike Edmunds):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/37092#comment:4>

Django

unread,
May 13, 2026, 7:22:28 PMMay 13
to django-...@googlegroups.com
#37092: No warning for deprecated USE_BLANK_CHOICE_DASH in settings.py
-------------------------------------+-------------------------------------
Reporter: Mike Edmunds | Owner: Jacob
| Walls
Type: Bug | Status: closed
Component: Forms | Version: dev
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 Jacob Walls <jacobtylerwalls@…>):

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

Comment:

In [changeset:"ed5486376989c08b34cc62e7c8ba4a07bd60047d" ed54863]:
{{{#!CommitTicketReference repository=""
revision="ed5486376989c08b34cc62e7c8ba4a07bd60047d"
Fixed #37092, Refs #35870 -- Added missing deprecation warnings for
USE_BLANK_CHOICE_DASH.

Follow-up to 63c56cda133a85a158502891c40465bc0331d3d9.

Modeled on 5d80843ebc5376d00f98bf2a6aadbada4c29365c.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/37092#comment:5>
Reply all
Reply to author
Forward
0 new messages