From fa62ed737c7a543a1439e711b31c7d7f59ca8a72 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Fri, 27 Dec 2024 15:56:02 +0800 Subject: [PATCH] fix: handle case where member is not found in role update API Signed-off-by: -LAN- --- api/controllers/console/workspace/members.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/controllers/console/workspace/members.py b/api/controllers/console/workspace/members.py index 1afb41ea87660c..a2b41c1d38f87d 100644 --- a/api/controllers/console/workspace/members.py +++ b/api/controllers/console/workspace/members.py @@ -122,7 +122,7 @@ def put(self, member_id): return {"code": "invalid-role", "message": "Invalid role"}, 400 member = db.session.get(Account, str(member_id)) - if member: + if not member: abort(404) try: