Commit 4a58f65e authored by Samuel GAIST's avatar Samuel GAIST

[protocoltemplates][api] Fixed ListCreateView base class and queryset

parent 37c838d0
Pipeline #47522 failed with stage
in 15 minutes and 58 seconds
......@@ -29,7 +29,7 @@
from ..common import permissions as beat_permissions
from ..common.api import CheckContributionNameView
from ..common.api import DiffView as DiffVersionView
from ..common.api import ListCreateContributionView
from ..common.api import ListCreateBaseView
from ..common.api import RetrieveUpdateDestroyContributionView
from ..common.api import ShareView as CommonShareView
from .models import ProtocolTemplate
......@@ -65,7 +65,7 @@ class ShareView(CommonShareView):
# ----------------------------------------------------------
class ListCreateView(ListCreateContributionView):
class ListCreateView(ListCreateBaseView):
Read/Write end point that list the protocol templates available
and allows the creation of new protocol templates only to admins
......@@ -77,6 +77,13 @@ class ListCreateView(ListCreateContributionView):
writing_serializer_class = ProtocolTemplateCreationSerializer
namespace = "api_protocoltemplates"
def get_queryset(self):
Returns what the requesting user can see including public items
return self.model.objects.for_user(self.request.user, True)
# ----------------------------------------------------------
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment