コード例 #1
0
def _get_multisite_custom_variable_names():
    # type: () -> List[str]
    return [
        name  #
        for name, attr in get_user_attributes()
        if attr.domain() == "multisite"
    ]
コード例 #2
0
def _add_custom_macro_attributes(profiles: Users) -> Users:
    updated_profiles = copy.deepcopy(profiles)

    # Add custom macros
    core_custom_macros = set(name  #
                             for name, attr in get_user_attributes()
                             if attr.add_custom_macro())
    for user in updated_profiles.keys():
        for macro in core_custom_macros:
            if macro in updated_profiles[user]:
                updated_profiles[user]['_' + macro] = updated_profiles[user][macro]

    return updated_profiles
コード例 #3
0
def _clear_config_based_user_attributes() -> None:
    for _name, attr in get_user_attributes():
        if attr.from_config():
            user_attribute_registry.unregister(attr.name())
コード例 #4
0
def _clear_config_based_user_attributes():
    # type: () -> None
    for _name, attr in get_user_attributes():
        if attr.from_config():
            del user_attribute_registry[attr.name()]