mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 22:19:48 +00:00
users: Ban names shorter than 3 characters.
The empty string is not a reasonable name.
This commit is contained in:
@@ -12,6 +12,8 @@ def check_full_name(full_name_raw):
|
||||
full_name = full_name_raw.strip()
|
||||
if len(full_name) > UserProfile.MAX_NAME_LENGTH:
|
||||
raise JsonableError(_("Name too long!"))
|
||||
if len(full_name) < UserProfile.MIN_NAME_LENGTH:
|
||||
raise JsonableError(_("Name too short!"))
|
||||
if list(set(full_name).intersection(UserProfile.NAME_INVALID_CHARS)):
|
||||
raise JsonableError(_("Invalid characters in name!"))
|
||||
return full_name
|
||||
|
||||
Reference in New Issue
Block a user