Skip to content

Commit 03e2c5a

Browse files
fix: error handling
1 parent d3911dc commit 03e2c5a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/api/plane/api/middleware/api_authentication.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def validate_api_token(self, token, workspace_slug):
3131
is_active=True,
3232
)
3333

34-
if workspace_slug:
34+
# If the api token has workspace_id, then check if it matches the workspace_slug
35+
if api_token.workspace_id and workspace_slug:
3536
workspace = Workspace.objects.get(slug=workspace_slug)
3637

3738
if api_token.workspace_id != workspace.id:

0 commit comments

Comments
 (0)