"benchmark/vscode:/vscode.git/clone" did not exist on "a4a3d8239365d2fc16e2dc707605373ea3f35ded"
Commit 0250f69d authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: valves

parent 5f2d37dc
...@@ -146,7 +146,7 @@ class FunctionsTable: ...@@ -146,7 +146,7 @@ class FunctionsTable:
def get_function_valves_by_id(self, id: str) -> Optional[dict]: def get_function_valves_by_id(self, id: str) -> Optional[dict]:
try: try:
function = Function.get(Function.id == id) 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: except Exception as e:
print(f"An error occurred: {e}") print(f"An error occurred: {e}")
return None return None
......
...@@ -117,7 +117,7 @@ class ToolsTable: ...@@ -117,7 +117,7 @@ class ToolsTable:
def get_tool_valves_by_id(self, id: str) -> Optional[dict]: def get_tool_valves_by_id(self, id: str) -> Optional[dict]:
try: try:
tool = Tool.get(Tool.id == id) 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: except Exception as e:
print(f"An error occurred: {e}") print(f"An error occurred: {e}")
return None return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment