Fixed #15336 -- Silenced a warning about the DATABASES transition when a database backend isn't specified. Thanks to Ivan Sagalaev for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15571 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2011-02-19 08:10:19 +00:00
parent c63bc87a98
commit 563a164c05
1 changed files with 6 additions and 5 deletions

View File

@ -12,11 +12,12 @@ __all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError',
# For backwards compatibility - Port any old database settings over to
# the new values.
if not settings.DATABASES:
import warnings
warnings.warn(
"settings.DATABASE_* is deprecated; use settings.DATABASES instead.",
DeprecationWarning
)
if settings.DATABASE_ENGINE:
import warnings
warnings.warn(
"settings.DATABASE_* is deprecated; use settings.DATABASES instead.",
DeprecationWarning
)
settings.DATABASES[DEFAULT_DB_ALIAS] = {
'ENGINE': settings.DATABASE_ENGINE,