finish rewrite
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user