From 35fd9fddf848aa6d8659af2fcbc73841f9d6b7e7 Mon Sep 17 00:00:00 2001 From: Vignesh Hari Date: Tue, 22 Sep 2020 17:36:56 +0530 Subject: [PATCH] remove Delete endpoint from shifting --- care/facility/api/viewsets/shifting.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/care/facility/api/viewsets/shifting.py b/care/facility/api/viewsets/shifting.py index 6c1e4fecc8..33648e03b6 100644 --- a/care/facility/api/viewsets/shifting.py +++ b/care/facility/api/viewsets/shifting.py @@ -10,6 +10,8 @@ from rest_framework.exceptions import ValidationError from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response +from rest_framework import mixins +from rest_framework.viewsets import GenericViewSet from care.facility.api.serializers.patient_icmr import PatientICMRSerializer from care.facility.api.serializers.shifting import ShiftingDetailSerializer, ShiftingSerializer @@ -82,7 +84,9 @@ def get_status( modified_date = filters.DateFromToRangeFilter(field_name="modified_date") -class ShiftingViewSet(viewsets.ModelViewSet): +class ShiftingViewSet( + mixins.CreateModelMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, GenericViewSet +): serializer_class = ShiftingSerializer lookup_field = "external_id" queryset = (