mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
Also don't raise an exception during import for the Settings class since that's now deprecated.
This commit is contained in:
parent
3a2fde649f
commit
2c39f5f29b
1 changed files with 4 additions and 1 deletions
|
|
@ -19,7 +19,9 @@ install_failure = ("django-configurations settings importer wasn't "
|
|||
class ConfigurationBase(type):
|
||||
|
||||
def __new__(cls, name, bases, attrs):
|
||||
if bases != (object,) and bases[0].__name__ != 'NewBase':
|
||||
# also check for "Configuration" here to handle the Settings class below
|
||||
# remove it when we deprecate the Settings class
|
||||
if bases != (object,) and bases[0].__name__ not in ('NewBase', 'Configuration'):
|
||||
# if this is actually a subclass in a settings module
|
||||
# we better check if the importer was correctly installed
|
||||
from . import importer
|
||||
|
|
@ -82,6 +84,7 @@ class Settings(Configuration):
|
|||
|
||||
@classmethod
|
||||
def pre_setup(cls):
|
||||
# make sure to remove the handling of the Settings class above when deprecating
|
||||
warnings.warn("configurations.Settings was renamed to "
|
||||
"settings.Configuration and will be "
|
||||
"removed in 1.0", PendingDeprecationWarning)
|
||||
|
|
|
|||
Loading…
Reference in a new issue