minor fix: remove duplicates, fix typo, and add restriction for get mcp server (#22170)

Signed-off-by: neatguycoding <15627489+NeatGuyCoding@users.noreply.github.com>
This commit is contained in:
NeatGuyCoding
2025-07-11 09:40:17 +08:00
committed by GitHub
parent f4df80e093
commit f929bfb94c
3 changed files with 7 additions and 4 deletions

View File

@@ -90,7 +90,11 @@ class AppMCPServerRefreshController(Resource):
def get(self, server_id):
if not current_user.is_editor:
raise NotFound()
server = db.session.query(AppMCPServer).filter(AppMCPServer.id == server_id).first()
server = (
db.session.query(AppMCPServer)
.filter(AppMCPServer.id == server_id and AppMCPServer.tenant_id == current_user.current_tenant_id)
.first()
)
if not server:
raise NotFound()
server.server_code = AppMCPServer.generate_server_code(16)