Skip to content

Commit

Permalink
Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
luciferlinx101 committed Jun 29, 2023
1 parent fcbb758 commit d085c2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superagi/controllers/tool_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ def get_all_tool_configs(toolkit_name: str, organisation: Organisation = Depends
HTTPException (status_code=404): If the specified tool kit is not found.
HTTPException (status_code=403): If the user is not authorized to access the tool kit.
"""

user_toolkits = db.session.query(Toolkit).filter(Toolkit.organisation_id == organisation.id).all()
toolkit = db.session.query(Toolkit).filter_by(name=toolkit_name).first()
toolkit = db.session.query(Toolkit).filter(Toolkit.name == toolkit_name,
Toolkit.organisation_id == organisation.id).first()
if not toolkit:
raise HTTPException(status_code=404, detail='ToolKit not found')
if toolkit.name not in [user_toolkit.name for user_toolkit in user_toolkits]:
Expand Down

0 comments on commit d085c2f

Please sign in to comment.