summaryrefslogtreecommitdiff
path: root/django/apps
diff options
context:
space:
mode:
authorIuri de Silvio <iurisilvio@gmail.com>2020-08-10 15:16:45 -0300
committerGitHub <noreply@github.com>2020-08-10 20:16:45 +0200
commitebd78a9f97d8ba850d279a844d89a1d805370738 (patch)
tree4098ba912720e049b27db7ae6583d3407e32c4c7 /django/apps
parentad827ddaef05069a1385cc2d26fd2ab9c6ba1f4d (diff)
Fixed #31870 -- Fixed crash when populating app registry with empty or without apps module.
Regression in 3f2821af6bc48fa8e7970c1ce27bc54c3172545e.
Diffstat (limited to 'django/apps')
-rw-r--r--django/apps/config.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/django/apps/config.py b/django/apps/config.py
index 8c276d5d34..928e19ac44 100644
--- a/django/apps/config.py
+++ b/django/apps/config.py
@@ -89,6 +89,7 @@ class AppConfig:
"""
# create() eventually returns app_config_class(app_name, app_module).
app_config_class = None
+ app_config_name = None
app_name = None
app_module = None
@@ -161,12 +162,15 @@ class AppConfig:
)
else:
message += (
- "However, Django's automatic detection picked another "
- "configuration, %r. You should move the default "
- "config class to the apps submodule of your "
- "application and, if this module defines several "
- "config classes, mark the default one with default = "
- "True." % app_config_name
+ "However, Django's automatic detection %s. You should "
+ "move the default config class to the apps submodule "
+ "of your application and, if this module defines "
+ "several config classes, mark the default one with "
+ "default = True." % (
+ "picked another configuration, %r" % app_config_name
+ if app_config_name
+ else "did not find this configuration"
+ )
)
warnings.warn(message, RemovedInDjango41Warning, stacklevel=2)
entry = new_entry