Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

types: Add default_group_name field to GroupPermissionSetting type.

Sahil Batra138a67d97e71
diff --git a/zerver/lib/types.py b/zerver/lib/types.py
index 430fec2ea9e..fc89a665cf9 100644
--- a/zerver/lib/types.py
+++ b/zerver/lib/types.py
@@ -280,3 +280,4 @@ class GroupPermissionSetting:
allow_internet_group: bool
allow_owners_group: bool
allow_nobody_group: bool
+ default_group_name: str
diff --git a/zerver/models.py b/zerver/models.py
index 52132650212..5fa5fb184ec 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -2643,6 +2643,7 @@ class Stream(models.Model):
allow_internet_group=False,
allow_owners_group=False,
allow_nobody_group=False,
+ default_group_name=UserGroup.ADMINISTRATORS_GROUP_NAME,
),
}
diff --git a/zerver/views/streams.py b/zerver/views/streams.py
index c4ae4acb38e..6fc844d97b9 100644
--- a/zerver/views/streams.py
+++ b/zerver/views/streams.py
@@ -591,8 +591,13 @@ def add_subscriptions_backend(
allow_nobody_group=False,
)
else:
+ can_remove_subscribers_group_default = Stream.stream_permission_group_settings[
+ "can_remove_subscribers_group"
+ ].default_group_name
can_remove_subscribers_group = UserGroup.objects.get(
- name="@role:administrators", realm=user_profile.realm, is_system_group=True
+ name=can_remove_subscribers_group_default,
+ realm=user_profile.realm,
+ is_system_group=True,
)
for stream_dict in streams_raw: