summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-02-19 08:14:44 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-02-19 08:14:44 +0000
commit10a12cd6f261f4804850710be9bcdb24026d7fd2 (patch)
tree158b25543d0618e9770d16b2a98a25fb3874f2da
parent19fa3bcebc979f20ed00f1aa1d09ff2ebf7e0473 (diff)
[1.2.X] 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.
Backport of r15571 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/__init__.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/django/db/__init__.py b/django/db/__init__.py
index 7136b2f258..9bfe4659bf 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.",
- PendingDeprecationWarning
- )
+ if settings.DATABASE_ENGINE:
+ import warnings
+ warnings.warn(
+ "settings.DATABASE_* is deprecated; use settings.DATABASES instead.",
+ PendingDeprecationWarning
+ )
settings.DATABASES[DEFAULT_DB_ALIAS] = {
'ENGINE': settings.DATABASE_ENGINE,