Commits

russ...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 610da87

[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.

  • Participants
  • Parent commits 7fc38b4
  • Branches releases/1.2.X

Comments (0)

Files changed (1)

File django/db/__init__.py

 # 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,