lab3: second tiny fix

This commit is contained in:
yurtaev.va
2026-10-23 19:29:40 +03:00
parent 3a3302c5b4
commit 088961a433
24 changed files with 477 additions and 134 deletions
+1 -1
View File
@@ -333,7 +333,7 @@ async def create_user(request: Request):
invalid("Некорректный username")
display = text_field(data["display_name"], 100)
password = data["password"]
if not isinstance(password, str) or not 12 <= len(password) <= 128:
if not isinstance(password, str) or not password.strip() or not 12 <= len(password) <= 128:
invalid("Некорректный пароль")
try:
return await asyncio.to_thread(insert_user, name, display, password)