|
|
@ -20,7 +20,7 @@ def checkUsernameLength(username: str):
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def checkUserExists(username: str, db: str):
|
|
|
|
def checkUserExists(username: str):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
pwd.getpwnam(username)
|
|
|
|
pwd.getpwnam(username)
|
|
|
|
except KeyError:
|
|
|
|
except KeyError:
|
|
|
@ -98,7 +98,7 @@ def checkImportFile(fname: str, db: str):
|
|
|
|
if not lib.validator.checkEmail(row["email"]):
|
|
|
|
if not lib.validator.checkEmail(row["email"]):
|
|
|
|
error_list += f"Line {ln}: E-Mail address of user '{row['username']}' '{row['email']}' is not valid.\n"
|
|
|
|
error_list += f"Line {ln}: E-Mail address of user '{row['username']}' '{row['email']}' is not valid.\n"
|
|
|
|
valid = False
|
|
|
|
valid = False
|
|
|
|
if not lib.validator.checkUserExists(row["username"], db) or checkUserInDB(row["username"], db):
|
|
|
|
if not lib.validator.checkUserExists(row["username"]) or checkUserInDB(row["username"], db):
|
|
|
|
error_list += f"Line {ln}: User '{row['username']}' already exists.\n"
|
|
|
|
error_list += f"Line {ln}: User '{row['username']}' already exists.\n"
|
|
|
|
valid = False
|
|
|
|
valid = False
|
|
|
|
if not lib.validator.checkDatetimeFormat(row["timestamp"]):
|
|
|
|
if not lib.validator.checkDatetimeFormat(row["timestamp"]):
|
|
|
|