1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +00:00

remove unnecessary call to settings.INSTALLED_APPS

This commit is contained in:
Ben Cail 2024-11-13 13:57:29 -05:00
parent 894b227d29
commit e2b4c14281

View File

@ -254,16 +254,9 @@ class ManagementUtility:
try: try:
app_name = commands[subcommand] app_name = commands[subcommand]
except KeyError: except KeyError:
if os.environ.get("DJANGO_SETTINGS_MODULE"): if os.environ.get("DJANGO_SETTINGS_MODULE") and self.settings_exception:
if self.settings_exception: sys.stderr.write(str(self.settings_exception) + "\n")
sys.stderr.write(str(self.settings_exception) + "\n") sys.exit(1)
sys.exit(1)
else:
# If `subcommand` is missing due to misconfigured settings, the
# following line will retrigger an ImproperlyConfigured exception
# (get_commands() swallows the original one) so the user is
# informed about it.
settings.INSTALLED_APPS
elif not settings.configured: elif not settings.configured:
sys.stderr.write("No Django settings specified.\n") sys.stderr.write("No Django settings specified.\n")
possible_matches = get_close_matches(subcommand, commands) possible_matches = get_close_matches(subcommand, commands)