mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +00:00
streams: Extract zephyr realm invite check.
This will be reused later in the `/channels/create` view. Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
1190afbe4f
commit
4d49fa6fbb
@@ -997,6 +997,15 @@ def check_stream_name_available(realm: Realm, name: str) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def check_zephyr_realm_invite_conditions(
|
||||
is_subscribing_other_users: bool, realm: Realm, invite_only: bool
|
||||
) -> None:
|
||||
if is_subscribing_other_users and realm.is_zephyr_mirror_realm and not invite_only:
|
||||
raise JsonableError(
|
||||
_("You can only invite other Zephyr mirroring users to private channels.")
|
||||
)
|
||||
|
||||
|
||||
def access_stream_by_name(
|
||||
user_profile: UserProfile,
|
||||
stream_name: str,
|
||||
|
||||
Reference in New Issue
Block a user