fix: error handling

This commit is contained in:
sangeethailango
2026-01-02 15:43:54 +05:30
parent d3911dc59f
commit 03e2c5a8d8

View File

@@ -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: