mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
list_to_streams: Use simpler if statement flow.
Since each if statement just raises an exception if triggered, removing the else blocks makes the logic more readable.
This commit is contained in:
@@ -665,13 +665,15 @@ def list_to_streams(
|
||||
# Guest users case will not be handled here as it will be
|
||||
# handled by the decorator in add_subscriptions_backend.
|
||||
raise JsonableError(_("Insufficient permission"))
|
||||
elif not autocreate:
|
||||
|
||||
if not autocreate:
|
||||
raise JsonableError(
|
||||
_("Stream(s) ({}) do not exist").format(
|
||||
", ".join(stream_dict["name"] for stream_dict in missing_stream_dicts),
|
||||
)
|
||||
)
|
||||
elif message_retention_days_not_none:
|
||||
|
||||
if message_retention_days_not_none:
|
||||
if not user_profile.is_realm_owner:
|
||||
raise OrganizationOwnerRequired()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user