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
|
@property
|
||||||
def user_id(self):
|
def user_id(self):
|
||||||
if hasattr(self, "_user_id"):
|
if hasattr(self, "_user_id") and self._user_id:
|
||||||
return self._user_id
|
return self._user_id
|
||||||
return self.graph.user_id
|
return self.graph.user_id
|
||||||
|
|
||||||
|
|
@ -477,7 +477,7 @@ class CustomComponent(BaseComponent):
|
||||||
if not self.user_id:
|
if not self.user_id:
|
||||||
msg = "Session is invalid"
|
msg = "Session is invalid"
|
||||||
raise ValueError(msg)
|
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(
|
async def run_flow(
|
||||||
self,
|
self,
|
||||||
|
|
@ -493,7 +493,7 @@ class CustomComponent(BaseComponent):
|
||||||
flow_id=flow_id,
|
flow_id=flow_id,
|
||||||
flow_name=flow_name,
|
flow_name=flow_name,
|
||||||
tweaks=tweaks,
|
tweaks=tweaks,
|
||||||
user_id=str(self._user_id),
|
user_id=str(self.user_id),
|
||||||
run_id=self.graph.run_id,
|
run_id=self.graph.run_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -502,7 +502,7 @@ class CustomComponent(BaseComponent):
|
||||||
msg = "Session is invalid"
|
msg = "Session is invalid"
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
try:
|
try:
|
||||||
return list_flows(user_id=str(self._user_id))
|
return list_flows(user_id=str(self.user_id))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = f"Error listing flows: {e}"
|
msg = f"Error listing flows: {e}"
|
||||||
raise ValueError(msg) from e
|
raise ValueError(msg) from e
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue