From 06f2dd72a7458769355f48516f3f3feda4d53562 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 1 Oct 2020 16:45:47 +0300 Subject: [PATCH] Exception: fix detail/code for exception. --- django_etebase/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_etebase/views.py b/django_etebase/views.py index ec3b373..31e914a 100644 --- a/django_etebase/views.py +++ b/django_etebase/views.py @@ -574,7 +574,8 @@ class InvitationOutgoingViewSet(InvitationBaseViewSet): return Response(content, status=status.HTTP_400_BAD_REQUEST) if not permissions.is_collection_admin(collection, request.user): - raise PermissionDenied('User is not an admin of this collection') + raise PermissionDenied({'code': 'admin_access_required', + 'detail': 'User is not an admin of this collection'}) serializer.save(collection=collection)