fix sshKeys notfound
parent
3a1143cf56
commit
612e237a28
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue