Skip to content

Commit 4eca510

Browse files
committed
Fix bug in workspace comparison code
1 parent f2125c3 commit 4eca510

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

multinet/api/views/session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.http.response import Http404
2+
from django.shortcuts import get_object_or_404
23
from drf_yasg.utils import swagger_auto_schema
34
from rest_framework import serializers, status
45
from rest_framework.decorators import action
@@ -49,7 +50,7 @@ def state(self, request, parent_lookup_workspace__name: str, pk=None):
4950

5051
workspace: Workspace = get_object_or_404(Workspace, name=parent_lookup_workspace__name)
5152
session_ws = session.table.workspace if hasattr(session, 'table') else session.network.workspace
52-
if workspace.id != session_ws:
53+
if workspace.id != session_ws.id:
5354
raise Http404
5455

5556
serializer = SessionStatePatchSerializer(data=request.data)

0 commit comments

Comments
 (0)