def apply(self, request, *args, **kwargs):
        changeset = self.get_object()
        with changeset.lock_to_edit(request) as changeset:
            if not changeset.can_end_review(request):
                raise PermissionDenied(_('You cannot accept and apply these changes.'))

            changeset.apply(request.user)
            return Response({'success': True})