Example #1
0
def get_user_config(user_name, config_key):
    """默认值参考DEFAULT_USER_CONFIG"""
    # 未启动,直接返回默认值
    if xconfig.START_TIME is None:
        return DEFAULT_USER_CONFIG.get(config_key)

    config = xauth.get_user_config_dict(user_name)
    default_value = DEFAULT_USER_CONFIG.get(config_key)
    if config is None:
        return default_value
    else:
        return config.get(config_key, default_value)
Example #2
0
def get_user_config_dict(user):
    if not xauth.has_login():
        return Storage()
    return xauth.get_user_config_dict(user)
Example #3
0
def get_config_dict(user_name):
    value = xauth.get_user_config_dict(user_name)
    if value is None:
        return Storage()
    return value