def update(self, request, *args, **kwargs):
        # Get motion.
        motion = self.get_object()

        # Check permissions.
        if not motion.get_allowed_actions(request.user)['update']:
            self.permission_denied(request)

        # Check permission to send only some data.
        if not request.user.has_perm('motions.can_manage'):
            whitelist = (
                'title',
                'text',
                'reason',)
            keys = list(request.data.keys())
            for key in keys:
                if key not in whitelist:
                    # Non-staff users are allowed to send only some data. Ignore other data.
                    del request.data[key]

        # Validate data and update motion.
        serializer = self.get_serializer(
            motion,
            data=request.data,
            partial=kwargs.get('partial', False))
        serializer.is_valid(raise_exception=True)
        updated_motion = serializer.save(disable_versioning=request.data.get('disable_versioning'))

        # Write the log message, check removal of supporters and initiate response.
        # TODO: Log if a version was updated.
        updated_motion.write_log([ugettext_noop('Motion updated')], request.user)
        if (config['motions_remove_supporters'] and updated_motion.state.allow_support and
                not request.user.has_perm('motions.can_manage')):
            updated_motion.supporters.clear()
            updated_motion.write_log([ugettext_noop('All supporters removed')], request.user)
        return Response(serializer.data)
.. versionadded:: 1.4.0
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/motions/views.py/MotionViewSet.update--crossover with--dataset/ETHPy150Open kivy/kivy/kivy/core/video/video_pygst.py/VideoPyGst.pause