mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 09:03:57 +00:00
initialize_voyager_db: Do nothing if a realm already exists.
This should help avoid confusing error messages for anyone accidentally running this twice. In particular, this also makes it easier to run Zulip inside Kubernetes, since one doesn't need to worry about duplicate calls.
This commit is contained in:
@@ -30,6 +30,9 @@ class Command(BaseCommand):
|
||||
help='The number of extra users to create')
|
||||
|
||||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
if Realm.objects.count() > 0:
|
||||
print("Database already initialized; doing nothing.")
|
||||
return
|
||||
realm = Realm.objects.create(string_id=settings.INTERNAL_BOT_DOMAIN.split('.')[0])
|
||||
|
||||
names = [(settings.FEEDBACK_BOT_NAME, settings.FEEDBACK_BOT)]
|
||||
|
||||
Reference in New Issue
Block a user