From 68f50d715089e4b21d815f1b8133f7cadf13b7d6 Mon Sep 17 00:00:00 2001 From: Kostanjevec Date: Wed, 15 Jun 2022 02:56:17 +0200 Subject: [PATCH] checking username duplicates seems to work --- auth.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/auth.py b/auth.py index 5e07073..4660785 100644 --- a/auth.py +++ b/auth.py @@ -24,6 +24,8 @@ def register(): error = 'Username is required.' elif not password: error = 'Password is required.' + elif dbsession.query(User).filter(User.username == username).first() != None: + error = "Username already exists, please choose another one" if error is None: try: