From 7d09be4aeb210ce4e1ba369193198f760b768b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Z=C3=BCrcher?= Date: Sat, 4 Sep 2021 17:52:57 +0100 Subject: [PATCH] Fixing exception if grocerylist is shared --- v1/list/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v1/list/permissions.py b/v1/list/permissions.py index e9d2ad8..52b22b6 100644 --- a/v1/list/permissions.py +++ b/v1/list/permissions.py @@ -32,4 +32,4 @@ def has_object_permission(self, request, view, obj): # Write/Read permissions are only allowed to the owner of the list. return obj.list.author == request.user or \ - obj.list.groceryshared.shared_to == request.user + obj.list.groceryshared_set.filter(shared_by=obj.list.author.pk, shared_to=request.user.pk).exists()