mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Add both Humbug and MIT internal users.
(imported from commit f300c6513a9756417285ba371cb2d3f6f26fc4a3)
This commit is contained in:
@@ -156,8 +156,8 @@ class Command(BaseCommand):
|
|||||||
mit_realm.save()
|
mit_realm.save()
|
||||||
|
|
||||||
# Create internal users
|
# Create internal users
|
||||||
internal_users = []
|
internal_mit_users = []
|
||||||
create_users(internal_users)
|
create_users(internal_mit_users)
|
||||||
|
|
||||||
create_classes(subs_list, mit_realm)
|
create_classes(subs_list, mit_realm)
|
||||||
|
|
||||||
@@ -171,6 +171,21 @@ class Command(BaseCommand):
|
|||||||
new_subscription = Subscription(userprofile=profile, recipient=recipient)
|
new_subscription = Subscription(userprofile=profile, recipient=recipient)
|
||||||
new_subscription.save()
|
new_subscription.save()
|
||||||
|
|
||||||
|
internal_humbug_users = []
|
||||||
|
create_users(internal_humbug_users)
|
||||||
|
humbug_class_list = ["devel", "all", "humbug", "design"]
|
||||||
|
create_classes(humbug_class_list, humbug_realm)
|
||||||
|
|
||||||
|
# Now subscribe everyone to these classes
|
||||||
|
profiles = UserProfile.objects.filter(realm=humbug_realm)
|
||||||
|
for cls in humbug_class_list:
|
||||||
|
zephyr_class = ZephyrClass.objects.get(name=cls, realm=humbug_realm)
|
||||||
|
recipient = Recipient.objects.get(type=Recipient.CLASS, type_id=zephyr_class.id)
|
||||||
|
for i, profile in enumerate(profiles):
|
||||||
|
# Subscribe to some classes.
|
||||||
|
new_subscription = Subscription(userprofile=profile, recipient=recipient)
|
||||||
|
new_subscription.save()
|
||||||
|
|
||||||
self.stdout.write("Successfully populated test database.\n")
|
self.stdout.write("Successfully populated test database.\n")
|
||||||
|
|
||||||
recipient_hash = {}
|
recipient_hash = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user