From 9d74abee0ba096e1c764f1c83e6fa9f142175322 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 24 Sep 2024 11:03:19 -0700 Subject: [PATCH] tools: Skip checks in recursive management calls. --- zerver/lib/test_fixtures.py | 2 ++ zerver/management/commands/import.py | 2 +- zilencer/management/commands/populate_db.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zerver/lib/test_fixtures.py b/zerver/lib/test_fixtures.py index 81ec42de14..19ce654fba 100644 --- a/zerver/lib/test_fixtures.py +++ b/zerver/lib/test_fixtures.py @@ -103,6 +103,7 @@ class Database: "DJANGO_SETTINGS_MODULE=" + self.settings, "ZULIP_DB_NAME=" + self.database_name, "./manage.py", + "--skip-checks", ] run([*manage_py, "migrate", "--no-input"]) @@ -309,6 +310,7 @@ def get_migration_status(**options: Any) -> str: no_color=options.get("no_color", False), settings=options.get("settings", os.environ["DJANGO_SETTINGS_MODULE"]), stdout=out, + skip_checks=options.get("skip_checks", True), traceback=options.get("traceback", True), verbosity=verbosity, ) diff --git a/zerver/management/commands/import.py b/zerver/management/commands/import.py index 1a31fab57d..12bc3ddf4d 100644 --- a/zerver/management/commands/import.py +++ b/zerver/management/commands/import.py @@ -58,7 +58,7 @@ import a database dump from one or more JSON files.""" parser.formatter_class = argparse.RawTextHelpFormatter def do_destroy_and_rebuild_database(self, db_name: str) -> None: - call_command("flush", verbosity=0, interactive=False) + call_command("flush", verbosity=0, skip_checks=True, interactive=False) subprocess.check_call([os.path.join(settings.DEPLOY_ROOT, "scripts/setup/flush-memcached")]) @override diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index 5c4b05afe2..e7de46f6dd 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -1116,7 +1116,7 @@ class Command(ZulipBaseCommand): if not options["test_suite"]: # We populate the analytics database here for # development purpose only - call_command("populate_analytics_db") + call_command("populate_analytics_db", skip_checks=True) threads = options["threads"] jobs: list[tuple[int, list[list[int]], dict[str, Any], int]] = []