mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
Access realm by string_id in management commands.
`Realm.string_id` replaces 'Realm.domain' in the management commands. Fixes #2325.
This commit is contained in:
@@ -12,8 +12,10 @@ from zerver.models import Message, UserProfile, Stream, Recipient, UserPresence,
|
||||
from zerver.lib.actions import STREAM_ASSIGNMENT_COLORS, do_send_message, \
|
||||
do_change_is_admin
|
||||
from django.conf import settings
|
||||
from zerver.lib.bulk_create import bulk_create_streams, bulk_create_users
|
||||
from zerver.models import DefaultStream, get_stream, get_realm
|
||||
from zerver.lib.bulk_create import bulk_create_realms, \
|
||||
bulk_create_streams, bulk_create_users, bulk_create_huddles, \
|
||||
bulk_create_clients
|
||||
from zerver.models import DefaultStream, get_stream, get_realm_by_string_id
|
||||
from zilencer.models import Deployment
|
||||
import datetime
|
||||
|
||||
@@ -185,7 +187,7 @@ class Command(BaseCommand):
|
||||
subscriptions_to_add.append(s)
|
||||
Subscription.objects.bulk_create(subscriptions_to_add)
|
||||
else:
|
||||
zulip_realm = get_realm("zulip.com")
|
||||
zulip_realm = get_realm_by_string_id("zulip")
|
||||
recipient_streams = [klass.type_id for klass in
|
||||
Recipient.objects.filter(type=Recipient.STREAM)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user