Skip to content

Commit

Permalink
chore: Simplify error check
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Puerto committed Feb 12, 2025
1 parent 931ec59 commit 154839f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/user_workspaces_server/views/workspace_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,9 @@ def delete(self, request, workspace_id):

# If this is a workspace that has shared workspaces associated that have not been accepted, error out
try:
shared_workspaces = models.SharedWorkspaceMapping.objects.filter(
if models.SharedWorkspaceMapping.objects.filter(
original_workspace_id=workspace, is_accepted=False
).all()
if shared_workspaces:
).exists():
raise WorkspaceClientException(
f"Workspace {workspace_id} has shared workspaces associated with it, that have not yet been accepted. Please cancel those shares to delete this workspace."
)
Expand Down

0 comments on commit 154839f

Please sign in to comment.