fix: correct user_id access logic (#4595)
fix: correct user_id access logic.
This commit is contained in:
parent
2f96dbbdd4
commit
0f5c31fd08
1 changed files with 4 additions and 4 deletions
|
|
@ -185,7 +185,7 @@ class CustomComponent(BaseComponent):
|
|||
|
||||
@property
|
||||
def user_id(self):
|
||||
if hasattr(self, "_user_id"):
|
||||
if hasattr(self, "_user_id") and self._user_id:
|
||||
return self._user_id
|
||||
return self.graph.user_id
|
||||
|
||||
|
|
@ -477,7 +477,7 @@ class CustomComponent(BaseComponent):
|
|||
if not self.user_id:
|
||||
msg = "Session is invalid"
|
||||
raise ValueError(msg)
|
||||
return await load_flow(user_id=str(self._user_id), flow_id=flow_id, tweaks=tweaks)
|
||||
return await load_flow(user_id=str(self.user_id), flow_id=flow_id, tweaks=tweaks)
|
||||
|
||||
async def run_flow(
|
||||
self,
|
||||
|
|
@ -493,7 +493,7 @@ class CustomComponent(BaseComponent):
|
|||
flow_id=flow_id,
|
||||
flow_name=flow_name,
|
||||
tweaks=tweaks,
|
||||
user_id=str(self._user_id),
|
||||
user_id=str(self.user_id),
|
||||
run_id=self.graph.run_id,
|
||||
)
|
||||
|
||||
|
|
@ -502,7 +502,7 @@ class CustomComponent(BaseComponent):
|
|||
msg = "Session is invalid"
|
||||
raise ValueError(msg)
|
||||
try:
|
||||
return list_flows(user_id=str(self._user_id))
|
||||
return list_flows(user_id=str(self.user_id))
|
||||
except Exception as e:
|
||||
msg = f"Error listing flows: {e}"
|
||||
raise ValueError(msg) from e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue