Skip to content

Commit

Permalink
Update delete_workflow (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkylekelly authored Nov 28, 2024
1 parent 6178c29 commit 7d285e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/agentscope/studio/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,11 @@ def _delete_workflow() -> Response:
if not filename:
return jsonify({"error": "Filename is required"})

if not filename.endswith(".json"):
return jsonify({"error": "Only JSON files can be deleted"})

filename = os.path.basename(filename)

filepath = os.path.join(user_dir, filename)
if not os.path.exists(filepath):
return jsonify({"error": "File not found"})
Expand Down

0 comments on commit 7d285e8

Please sign in to comment.