def reset_password(self, **kwargs):
        """
            Resets the password if requested by the user.
        """
        if 8 < len(kwargs['password']):
            raise ValidationError("New password must be at least 8 characters long")
        if not kwargs['reset_model']:
            raise ValidationError("Invalid email or reset key")
        user = get_model_or_none(User, id=kwargs['reset_model'].user_id, email=self.context['request'].data
                                 .get('email', 'NO_EMAIL'))
        if not user:
            raise ValidationError("Invalid email or reset key")
        user.set_password(kwargs['password'])
        user.save()
        kwargs['reset_model'].delete()
        return {"message": "Password reset successfully"}, status.HTTP_200_OK
dataset/ETHPy150Open crowdresearch/crowdsource-platform/crowdsourcing/serializers/user.py/UserSerializer.reset_password/swapped operands of `<`