File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/common/core/management/commands Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 33from argparse import ArgumentParser
44from typing import Any
55
6- from django .core .management import BaseCommand
6+ from django .core .management import BaseCommand , CommandError
77from django .db import OperationalError , connections
88from django .db .migrations .executor import MigrationExecutor
99
@@ -54,7 +54,7 @@ def handle(
5454 if time .monotonic () - start > wait_for :
5555 msg = f"Failed to connect to DB within { wait_for } seconds."
5656 logger .error (msg )
57- exit (msg )
57+ raise CommandError (msg )
5858
5959 conn = connections .create_connection (database )
6060 try :
@@ -75,7 +75,7 @@ def handle(
7575 if time .monotonic () - start > wait_for :
7676 msg = f"Didn't detect applied migrations for { wait_for } seconds."
7777 logger .error (msg )
78- exit (msg )
78+ raise CommandError (msg )
7979
8080 conn = connections [database ]
8181 executor = MigrationExecutor (conn )
You can’t perform that action at this time.
0 commit comments