fix sshKeys notfound

pull/12/head
def 2022-07-31 00:16:42 +02:00
parent 3a1143cf56
commit 612e237a28
2 changed files with 3 additions and 4 deletions

View File

@ -52,6 +52,8 @@ def get_user_by_username(username: str) -> typing.Optional[User]:
for user in data["users"]:
if user["username"] == username:
if "sshKeys" not in user:
user["sshKeys"] = []
return User(
user_type=UserType.NORMAL,

View File

@ -44,10 +44,7 @@ def create_user_util(username, password):
ensure_ssh_and_users_fields_exist(data)
data["users"].append(
{
"username": username,
"hashedPassword": hashed_password,
}
{"username": username, "hashedPassword": hashed_password, "sshKeys": []}
)
return True, "User was successfully created!", 201