Permalink
Browse files

Fixed #15336 -- Silenced a warning about the DATABASES transition whe…

…n 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
  • Loading branch information...
1 parent c63bc87 commit 563a164c056497fb8ac5c5c2cc8e8643213de94e @freakboy3742 freakboy3742 committed Feb 19, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 django/db/__init__.py
View
@@ -12,11 +12,12 @@
# 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,

0 comments on commit 563a164

Please sign in to comment.