From 563a164c056497fb8ac5c5c2cc8e8643213de94e Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 19 Feb 2011 08:10:19 +0000 Subject: [PATCH] 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 --- django/db/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/django/db/__init__.py b/django/db/__init__.py index 025025c8eb..3f9645a452 100644 --- a/django/db/__init__.py +++ b/django/db/__init__.py @@ -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,