Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct user_id access logic #4595

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def graph(self):

@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

Expand Down Expand Up @@ -477,7 +477,7 @@ async def load_flow(self, flow_id: str, tweaks: dict | None = None) -> Graph:
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,
Expand All @@ -493,7 +493,7 @@ async def run_flow(
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,
)

Expand All @@ -502,7 +502,7 @@ def list_flows(self) -> list[Data]:
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
Expand Down