Showing
2 changed files
with
2 additions
and
2 deletions
@@ -36,7 +36,7 @@ class EdictoViewSet(mixins.CreateModelMixin, | @@ -36,7 +36,7 @@ class EdictoViewSet(mixins.CreateModelMixin, | ||
36 | usuario_movimiento=usuario, | 36 | usuario_movimiento=usuario, |
37 | ) | 37 | ) |
38 | 38 | ||
39 | - @action(detail=True, methods=['put']) | 39 | + @action(detail=True, methods=['patch']) |
40 | def custom_update(self, request): | 40 | def custom_update(self, request): |
41 | instance = self.get_object() | 41 | instance = self.get_object() |
42 | serializer = self.get_serializer(instance, data=request.data) | 42 | serializer = self.get_serializer(instance, data=request.data) |
@@ -40,7 +40,7 @@ class EdictoSerializer(serializers.ModelSerializer): | @@ -40,7 +40,7 @@ class EdictoSerializer(serializers.ModelSerializer): | ||
40 | 40 | ||
41 | def to_representation(self, instance): | 41 | def to_representation(self, instance): |
42 | data = super().to_representation(instance) | 42 | data = super().to_representation(instance) |
43 | - if instance.fecha_modificacion is not None and self.context['request'].method == 'PUT': | 43 | + if instance.fecha_modificacion is not None and self.context['request'].method == 'PATCH': |
44 | data['fecha_modificacion'] = instance.fecha_modificacion | 44 | data['fecha_modificacion'] = instance.fecha_modificacion |
45 | else: | 45 | else: |
46 | data['fecha_modificacion'] = None | 46 | data['fecha_modificacion'] = None |
-
Please register or login to post a comment