finish rewrite

This commit is contained in:
2026-08-25 16:20:27 +02:00
parent cfa862d4e5
commit 0bb7ca21cf
5 changed files with 73 additions and 38 deletions
+6 -3
View File
@@ -243,6 +243,9 @@ class User:
for domain in domains:
domain = domain.strip()
if len(domain) < 1:
continue
cursor.execute('''
INSERT INTO Domains (domain, userid) VALUES (?, ?)
''', (domain, userid))
@@ -270,15 +273,15 @@ class User:
if not User.exists(db_path, userid):
raise ValueError(f"User {userid} does not exist")
if not token_name.isalnum():
raise ValueError("Token name has to be alphanumeric")
if len(token_name) < 1:
raise ValueError("Token name has to be at least 1 character long")
if len(token_name) > 16:
raise ValueError("Token name has to be at most 16 characters long")
if not token_name.isalnum():
raise ValueError("Token name has to be alphanumeric")
token_name_list = User.get_token_names(db_path, userid)
if len(token_name_list) >= 5: