mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
Set default default streams for enterprise installations.
(imported from commit 87b9fdc6ef19a88a2abda4ba5cdfe2a5b35d581d)
This commit is contained in:
@@ -7,6 +7,7 @@ from zerver.models import UserProfile, Stream, Recipient, \
|
|||||||
Subscription, Realm, get_client, email_to_username
|
Subscription, Realm, get_client, email_to_username
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from zerver.lib.bulk_create import bulk_create_streams, bulk_create_users
|
from zerver.lib.bulk_create import bulk_create_streams, bulk_create_users
|
||||||
|
from zerver.lib.actions import set_default_streams
|
||||||
|
|
||||||
from optparse import make_option
|
from optparse import make_option
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
def handle(self, **options):
|
def handle(self, **options):
|
||||||
Realm.objects.create(domain="zulip.com")
|
Realm.objects.create(domain="zulip.com")
|
||||||
Realm.objects.create(domain=settings.ADMIN_DOMAIN)
|
admin_realm = Realm.objects.create(domain=settings.ADMIN_DOMAIN)
|
||||||
realms = {}
|
realms = {}
|
||||||
for realm in Realm.objects.all():
|
for realm in Realm.objects.all():
|
||||||
realms[realm.domain] = realm
|
realms[realm.domain] = realm
|
||||||
@@ -57,6 +58,8 @@ class Command(BaseCommand):
|
|||||||
bot.bot_owner = bot
|
bot.bot_owner = bot
|
||||||
bot.save()
|
bot.save()
|
||||||
|
|
||||||
|
set_default_streams(admin_realm, ["social", "engineering"])
|
||||||
|
|
||||||
self.stdout.write("Successfully populated database with initial data.\n")
|
self.stdout.write("Successfully populated database with initial data.\n")
|
||||||
|
|
||||||
site = Site.objects.get_current()
|
site = Site.objects.get_current()
|
||||||
|
|||||||
Reference in New Issue
Block a user