def update(self, request, *args, **kwargs):
        """Update a resource."""
        # NOTE: Use the original method instead when support for locking is added:
        #       https://github.com/encode/django-rest-framework/issues/4675
        # return super().update(request, *args, **kwargs)
        with transaction.atomic():
            return self._update(request, *args, **kwargs)
def update ( self , request , * args , ** kwargs ) : with transaction . atomic ( ) : return self . _update ( request , * args , ** kwargs )
Update a resource.