Пример #1
0
def _get_enabled_and_disabled_sites(
    user: LoggedInUser, ) -> Tuple[SiteConfigurations, SiteConfigurations]:
    enabled_sites: SiteConfigurations = {}
    disabled_sites: SiteConfigurations = {}

    for site_id, site_spec in user.authorized_sites().items():
        site_spec = _site_config_for_livestatus(site_id, site_spec)

        if user.is_site_disabled(site_id):
            disabled_sites[site_id] = site_spec
        else:
            enabled_sites[site_id] = site_spec

    return enabled_sites, disabled_sites
Пример #2
0
def _get_enabled_and_disabled_sites(
    user: LoggedInUser, ) -> Tuple[SiteConfigurations, SiteConfigurations]:
    enabled_sites: SiteConfigurations = SiteConfigurations({})
    disabled_sites: SiteConfigurations = SiteConfigurations({})

    for site_id, site_spec in user.authorized_sites().items():
        site_spec = _site_config_for_livestatus(site_id, site_spec)
        # Astroid 2.x bug prevents us from using NewType https://github.com/PyCQA/pylint/issues/2296
        # pylint: disable=unsupported-assignment-operation
        if user.is_site_disabled(site_id):
            disabled_sites[site_id] = site_spec
        else:
            enabled_sites[site_id] = site_spec

    return enabled_sites, disabled_sites