mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
management: Refactor checkconfig code to live in library.
This makes it possible to call this from other management commands.
This commit is contained in:
@@ -5,16 +5,10 @@ from typing import Any
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from zerver.lib.management import check_config
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = """Checks your Zulip Voyager Django configuration for issues."""
|
||||
|
||||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
for (setting_name, default) in settings.REQUIRED_SETTINGS:
|
||||
try:
|
||||
if settings.__getattr__(setting_name) != default:
|
||||
continue
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
print("Error: You must set %s in /etc/zulip/settings.py." % (setting_name,))
|
||||
sys.exit(1)
|
||||
check_config()
|
||||
|
||||
Reference in New Issue
Block a user