def update(self, request, *args, **kwargs):
        """
        Customized view endpoint to update an user.

        Checks also whether the requesting user can update the user. He
        needs at least the permissions 'users.can_see_name' (see
        self.check_view_permissions()). Also it is evaluated whether he
        wants to update himself or is manager.
        """
        # Check manager perms
        if (request.user.has_perm('users.can_see_extra_data') and
                request.user.has_perm('users.can_manage')):
            if request.data.get('is_active') is False and self.get_object() == request.user:
                # A user can not deactivate himself.
                raise ValidationError({'detail': _('You can not deactivate yourself.')})
            response = super().update(request, *args, **kwargs)
        else:
            # Get user.
            user = self.get_object()
            # Check permissions only to update yourself.
            if request.user != user:
                self.permission_denied(request)
            # Check permission to send only some data.
            whitelist = (
                'username',
                'title',
                'first_name',
                'last_name',
                'structure_level',
                'about_me',)
            keys = list(request.data.keys())
            for key in keys:
                if whitelist not in key:
                    # Non-staff users are allowed to send only some data. Ignore other data.
                    del request.data[key]
            # Validate data and update user.
            serializer = self.get_serializer(
                user,
                data=request.data,
                partial=kwargs.get('partial', False))
            serializer.is_valid(raise_exception=True)
            serializer.save()
            response = Response(serializer.data)
        return response
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/users/views.py/UserViewSet.update/swapped operands of `not in`