Skip to content

Commit

Permalink
[1.2.X] Fixed #15336 -- Silenced a warning about the DATABASES transi…
Browse files Browse the repository at this point in the history
…tion 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
  • Loading branch information
freakboy3742 committed Feb 19, 2011
1 parent 19fa3bc commit 10a12cd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions django/db/__init__.py
Expand Up @@ -12,11 +12,12 @@
# For backwards compatibility - Port any old database settings over to # For backwards compatibility - Port any old database settings over to
# the new values. # the new values.
if not settings.DATABASES: if not settings.DATABASES:
import warnings if settings.DATABASE_ENGINE:
warnings.warn( import warnings
"settings.DATABASE_* is deprecated; use settings.DATABASES instead.", warnings.warn(
PendingDeprecationWarning "settings.DATABASE_* is deprecated; use settings.DATABASES instead.",
) PendingDeprecationWarning
)


settings.DATABASES[DEFAULT_DB_ALIAS] = { settings.DATABASES[DEFAULT_DB_ALIAS] = {
'ENGINE': settings.DATABASE_ENGINE, 'ENGINE': settings.DATABASE_ENGINE,
Expand Down

0 comments on commit 10a12cd

Please sign in to comment.