mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
user_groups: Do not allow empty group names in backend.
We now raise error if a user tries to create a group with empty name or tries to update a group name to be empty.
This commit is contained in:
@@ -214,6 +214,9 @@ def access_user_group_for_setting(
|
||||
|
||||
|
||||
def check_user_group_name(group_name: str) -> str:
|
||||
if group_name.strip() == "":
|
||||
raise JsonableError(_("User group name can't be empty!"))
|
||||
|
||||
if len(group_name) > UserGroup.MAX_NAME_LENGTH:
|
||||
raise JsonableError(
|
||||
_("User group name cannot exceed {max_length} characters.").format(
|
||||
|
||||
Reference in New Issue
Block a user