install: Don't create internal realm in the installation process.

This commit is contained in:
Mateusz Mandera
2020-02-12 16:39:12 +01:00
parent d9aa4161f8
commit 56c1ad1a3d
5 changed files with 13 additions and 42 deletions

View File

@@ -1,6 +1,5 @@
from django.conf import settings
from zerver.lib.actions import do_change_is_admin
from zerver.lib.bulk_create import bulk_create_users
from zerver.models import Realm, UserProfile, email_to_username, get_client, \
get_system_bot
@@ -8,9 +7,11 @@ from zerver.models import Realm, UserProfile, email_to_username, get_client, \
from typing import Iterable, Optional, Tuple
def server_initialized() -> bool:
return Realm.objects.count() > 0
return Realm.objects.exists()
def create_internal_realm() -> None:
from zerver.lib.actions import do_change_is_admin
realm = Realm.objects.create(string_id=settings.SYSTEM_BOT_REALM)
# Create the "website" and "API" clients: