From 03e2c5a8d8cd21e618ed5bd78a7b1cf2c85a2404 Mon Sep 17 00:00:00 2001 From: sangeethailango Date: Fri, 2 Jan 2026 15:43:54 +0530 Subject: [PATCH] fix: error handling --- apps/api/plane/api/middleware/api_authentication.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/plane/api/middleware/api_authentication.py b/apps/api/plane/api/middleware/api_authentication.py index 2792c8d55b..87fdce7657 100644 --- a/apps/api/plane/api/middleware/api_authentication.py +++ b/apps/api/plane/api/middleware/api_authentication.py @@ -31,7 +31,8 @@ class APIKeyAuthentication(authentication.BaseAuthentication): is_active=True, ) - if workspace_slug: + # If the api token has workspace_id, then check if it matches the workspace_slug + if api_token.workspace_id and workspace_slug: workspace = Workspace.objects.get(slug=workspace_slug) if api_token.workspace_id != workspace.id: