Auth: Create keys on different exception
FileNotFoundError is the proper exception to catch here rather than OSError. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
fa2acb2828
commit
f10a5cfee6
1 changed files with 1 additions and 1 deletions
|
|
@ -59,7 +59,7 @@ def load_auth_keys(disable_from_config: bool):
|
|||
with open("api_tokens.yml", "r", encoding="utf8") as auth_file:
|
||||
auth_keys_dict = yaml.safe_load(auth_file)
|
||||
AUTH_KEYS = AuthKeys.model_validate(auth_keys_dict)
|
||||
except OSError:
|
||||
except FileNotFoundError:
|
||||
new_auth_keys = AuthKeys(
|
||||
api_key=secrets.token_hex(16), admin_key=secrets.token_hex(16)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue