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 , 4 weeks ago
| Cc: | added |
|---|---|
| Owner: | set to |
| Severity: | Normal → Release blocker |
| Status: | new → assigned |
| Triage Stage: | Unreviewed → Accepted |
comment:3 by , 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 , 3 weeks ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Yep, this was next on my list, thanks for the report!