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(backend): fix get agent db function #9350

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove user_id from graph_data in download_agent_file route
  • Loading branch information
Abhi1992002 committed Jan 28, 2025
commit c8b17c6d03c67408018a65100964267632806453
7 changes: 7 additions & 0 deletions autogpt_platform/backend/backend/server/v2/store/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,11 @@ async def download_agent_file(
store_listing_version_id=store_listing_version_id, version_id=version
)

if not graph_data:
raise fastapi.HTTPException(
status_code=404, detail=f"Graph with {store_listing_version_id} no found"
)

graph_data.clean_graph()
graph_date_dict = jsonable_encoder(graph_data)

Expand All @@ -620,6 +625,8 @@ def remove_credentials(obj):
del obj["credentials"]
if "creds" in obj:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a greater utility function that gets called :)

we can probably also strip anything that has secret = true

del obj["creds"]
if "user_id" in obj:
del obj["user_id"]

for value in obj.values():
remove_credentials(value)
Expand Down
Loading