Enzo Yair

se agrego metodo patch

@@ -14,7 +14,6 @@ from .utils import contador @@ -14,7 +14,6 @@ from .utils import contador
14 14
15 class EdictoViewSet(mixins.CreateModelMixin, 15 class EdictoViewSet(mixins.CreateModelMixin,
16 mixins.RetrieveModelMixin, 16 mixins.RetrieveModelMixin,
17 - mixins.UpdateModelMixin,  
18 mixins.ListModelMixin, 17 mixins.ListModelMixin,
19 viewsets.GenericViewSet): 18 viewsets.GenericViewSet):
20 19
@@ -36,10 +35,9 @@ class EdictoViewSet(mixins.CreateModelMixin, @@ -36,10 +35,9 @@ class EdictoViewSet(mixins.CreateModelMixin,
36 usuario_movimiento=usuario, 35 usuario_movimiento=usuario,
37 ) 36 )
38 37
39 - @action(detail=True, methods=['patch'])  
40 - def custom_update(self, request): 38 + def partial_update(self, request):
41 instance = self.get_object() 39 instance = self.get_object()
42 - serializer = self.get_serializer(instance, data=request.data) 40 + serializer = self.get_serializer(instance, data=request.data, partial=True)
43 serializer.is_valid(raise_exception=True) 41 serializer.is_valid(raise_exception=True)
44 42
45 edicto = request.data.get('cuerpo_edicto') 43 edicto = request.data.get('cuerpo_edicto')