Fix user_id attribute in list_flows method

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-11-27 21:51:10 -03:00
commit 5c90a9013c

View file

@ -5,7 +5,6 @@ from uuid import UUID
import yaml import yaml
from cachetools import TTLCache, cachedmethod from cachetools import TTLCache, cachedmethod
from fastapi import HTTPException from fastapi import HTTPException
from langflow.field_typing.constants import CUSTOM_COMPONENT_SUPPORTED_TYPES from langflow.field_typing.constants import CUSTOM_COMPONENT_SUPPORTED_TYPES
from langflow.interface.custom.component import Component from langflow.interface.custom.component import Component
from langflow.interface.custom.directory_reader import DirectoryReader from langflow.interface.custom.directory_reader import DirectoryReader
@ -232,7 +231,7 @@ class CustomComponent(Component):
return await build_sorted_vertices(graph_data, self.user_id) return await build_sorted_vertices(graph_data, self.user_id)
def list_flows(self, *, get_session: Optional[Callable] = None) -> List[Flow]: def list_flows(self, *, get_session: Optional[Callable] = None) -> List[Flow]:
if not self.user_id: if not self._user_id:
raise ValueError("Session is invalid") raise ValueError("Session is invalid")
try: try:
get_session = get_session or session_getter get_session = get_session or session_getter