From 49fd4427c8067938fc70f9d104920452a07f6c9a Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:08:13 +0530 Subject: [PATCH] chore: user settings endpoint (#2557) * chore: user settings endpoint * dev: fix the user settings --- apiserver/plane/api/serializers/user.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apiserver/plane/api/serializers/user.py b/apiserver/plane/api/serializers/user.py index ab28d0174..b8f9dedd4 100644 --- a/apiserver/plane/api/serializers/user.py +++ b/apiserver/plane/api/serializers/user.py @@ -79,14 +79,14 @@ class UserMeSettingsSerializer(BaseSerializer): email=obj.email ).count() if obj.last_workspace_id is not None: - workspace = Workspace.objects.get( + workspace = Workspace.objects.filter( pk=obj.last_workspace_id, workspace_member__member=obj.id - ) + ).first() return { "last_workspace_id": obj.last_workspace_id, - "last_workspace_slug": workspace.slug, + "last_workspace_slug": workspace.slug if workspace is not None else "", "fallback_workspace_id": obj.last_workspace_id, - "fallback_workspace_slug": workspace.slug, + "fallback_workspace_slug": workspace.slug if workspace is not None else "", "invites": workspace_invites, } else: