Skip to content

Commit e51a40f

Browse files
authored
Fix: launch an agent. (#13039)
### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent 8217ccc commit e51a40f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

api/apps/canvas_app.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,20 @@ def get_session(canvas_id, session_id):
633633
return get_json_result(
634634
data=False, message='Only owner of canvas authorized for this operation.',
635635
code=RetCode.OPERATING_ERROR)
636-
conv = API4ConversationService.get_by_id(session_id)
636+
_, conv = API4ConversationService.get_by_id(session_id)
637637
return get_json_result(data=conv.to_dict())
638-
638+
639+
640+
@manager.route('/<canvas_id>/sessions/<session_id>', methods=['DELETE']) # noqa: F821
641+
@login_required
642+
def del_session(canvas_id, session_id):
643+
tenant_id = current_user.id
644+
if not UserCanvasService.accessible(canvas_id, tenant_id):
645+
return get_json_result(
646+
data=False, message='Only owner of canvas authorized for this operation.',
647+
code=RetCode.OPERATING_ERROR)
648+
return get_json_result(data=API4ConversationService.delete_by_id(session_id))
649+
639650

640651
@manager.route('/prompts', methods=['GET']) # noqa: F821
641652
@login_required

0 commit comments

Comments
 (0)