diff options
Diffstat (limited to 'django/conf')
| -rw-r--r-- | django/conf/__init__.py | 13 | ||||
| -rw-r--r-- | django/conf/global_settings.py | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py index c7ae36aba0..25f5ffa305 100644 --- a/django/conf/__init__.py +++ b/django/conf/__init__.py @@ -16,12 +16,19 @@ from pathlib import Path import django from django.conf import global_settings from django.core.exceptions import ImproperlyConfigured +from django.utils.deprecation import RemovedInDjango70Warning, django_file_prefixes from django.utils.functional import LazyObject, empty ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE" DEFAULT_STORAGE_ALIAS = "default" STATICFILES_STORAGE_ALIAS = "staticfiles" +USE_BLANK_CHOICE_DASH_DEPRECATED_MSG = ( + "The USE_BLANK_CHOICE_DASH setting is deprecated. If you wish to define " + "your own default blank choice label, override " + "django.db.models.fields.BLANK_CHOICE_LABEL in your app's ready() method." +) + class SettingsReference(str): """ @@ -226,6 +233,12 @@ class UserSettingsHolder: def __setattr__(self, name, value): self._deleted.discard(name) + if name == "USE_BLANK_CHOICE_DASH": + warnings.warn( + USE_BLANK_CHOICE_DASH_DEPRECATED_MSG, + RemovedInDjango70Warning, + skip_file_prefixes=django_file_prefixes(), + ) super().__setattr__(name, value) def __delattr__(self, name): diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index 72c376dd78..b2d07cffba 100644 --- a/django/conf/global_settings.py +++ b/django/conf/global_settings.py @@ -218,6 +218,9 @@ TEMPLATES = [] # Default form rendering class. FORM_RENDERER = "django.forms.renderers.DjangoTemplates" +# RemovedInDjango70Warning: This setting allows to revert back to the old +# blank choice label in Django 6.1. +USE_BLANK_CHOICE_DASH = False # Default email address to use for various automated correspondence from # the site managers. |
