diff options
-rw-r--r-- | apioforum/auth.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apioforum/auth.py b/apioforum/auth.py index 8a34700..d5f2652 100644 --- a/apioforum/auth.py +++ b/apioforum/auth.py @@ -54,6 +54,8 @@ def register(): "SELECT 1 FROM users WHERE username = ?;", (username,) ).fetchone() is not None: err = f"User {username} is already registered." + elif len(username) > 20: + err = "username can't be longer than 20 characters" if err is None: db.execute( |