fix: valves

This commit is contained in:
Timothy J. Baek 2024-06-23 19:48:16 -07:00
parent 5f2d37dce5
commit 0250f69da0
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ class FunctionsTable:
def get_function_valves_by_id(self, id: str) -> Optional[dict]:
try:
function = Function.get(Function.id == id)
return function.valves if "valves" in function and function.valves else {}
return function.valves if function.valves else {}
except Exception as e:
print(f"An error occurred: {e}")
return None

View File

@ -117,7 +117,7 @@ class ToolsTable:
def get_tool_valves_by_id(self, id: str) -> Optional[dict]:
try:
tool = Tool.get(Tool.id == id)
return tool.valves if "valves" in tool and tool.valves else {}
return tool.valves if tool.valves else {}
except Exception as e:
print(f"An error occurred: {e}")
return None