import os

import cfgtools

pre_account_with_discount = None


def get_pre_account_with_discount():
    # type: (...) -> bool

    global pre_account_with_discount

    if pre_account_with_discount is None:
        config = cfgtools.read(os.environ["LOADERCFG"])
        pre_account_with_discount = config.find_value("Customizations.PreAccountWithDiscount", "false")

    return pre_account_with_discount.lower() == "true"
