add guard in case api key is a str
This commit is contained in:
parent
062a709151
commit
717334841f
1 changed files with 3 additions and 1 deletions
|
|
@ -323,5 +323,7 @@ def decrypt_api_key(
|
|||
):
|
||||
fernet = get_fernet(settings_service)
|
||||
# Two-way decryption
|
||||
decrypted_key = fernet.decrypt(encrypted_api_key.encode()).decode()
|
||||
if isinstance(encrypted_api_key, str):
|
||||
encrypted_api_key = encrypted_api_key.encode()
|
||||
decrypted_key = fernet.decrypt(encrypted_api_key).decode()
|
||||
return decrypted_key
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue