mirror of
https://github.com/sartography/spiffworkflow-backend.git
synced 2025-02-24 13:28:31 +00:00
mypy
This commit is contained in:
parent
33b8189493
commit
15b99bf904
@ -55,7 +55,7 @@ class SecretService:
|
||||
def get_secret(key: str) -> SecretModel:
|
||||
"""Get_secret."""
|
||||
secret = db.session.query(SecretModel).filter(SecretModel.key == key).first()
|
||||
if secret is not None:
|
||||
if isinstance(secret, SecretModel):
|
||||
return secret
|
||||
else:
|
||||
raise ApiError(
|
||||
|
@ -262,7 +262,7 @@ class UserService:
|
||||
.filter(PrincipalModel.user_id == user_id)
|
||||
.first()
|
||||
)
|
||||
if principal:
|
||||
if isinstance(principal, PrincipalModel):
|
||||
return principal
|
||||
raise ApiError(
|
||||
error_code="no_principal_found",
|
||||
|
Loading…
x
Reference in New Issue
Block a user