refactor: Fix variable type check in VariableService
This commit is contained in:
parent
238db494f1
commit
8b598ac103
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ class VariableService(Service):
|
||||||
# credential = session.query(Variable).filter(Variable.user_id == user_id, Variable.name == name).first()
|
# credential = session.query(Variable).filter(Variable.user_id == user_id, Variable.name == name).first()
|
||||||
variable = session.exec(select(Variable).where(Variable.user_id == user_id, Variable.name == name)).first()
|
variable = session.exec(select(Variable).where(Variable.user_id == user_id, Variable.name == name)).first()
|
||||||
|
|
||||||
if variable.type == "Credential" and field == "session_id":
|
if variable and variable.type == "Credential" and field == "session_id":
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
f"variable {name} of type 'Credential' cannot be used in a Session ID field "
|
f"variable {name} of type 'Credential' cannot be used in a Session ID field "
|
||||||
"because its purpose is to prevent the exposure of values."
|
"because its purpose is to prevent the exposure of values."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue