Check either internal or external urls for status 200.

Module Contents

fields_with_urls = ('lead', 'text', 'url')[source]
property site_collection:[source]
class, old_uri: str, new_uri: str = '')[source]

Bases: ModelsWithLinksMixin

migrate_url(item: object, fields: Iterable[str], test: bool = False, group_by: str | None = None, count_obj: dict[str, dict[str, int]] | None = None) tuple[int, dict[str, dict[str, int]]][source]

Supports replacing url’s and domain names.

migrate_site_collection(test: bool = False) tuple[int, dict[str, dict[str, int]]][source]
class, page:, new_name: str)[source]

Bases: ModelsWithLinksMixin

property subpages: list[][source]
execute(test: bool = False) int[source]

Executes a page name change. All subpages’ urls are changed by this action. For all subpages, the old and new url must be swapped in all possible fields of all sites of the SiteCollection.

classmethod from_form(model:, form: onegov.form.Form) typing_extensions.Self[source]
class str, link: str, url: str)[source]
ensure_protocol(url: str) str[source]
class, link_type: Literal['internal', 'external', ''] | None = None, total_timout: float = 30)[source]

Bases: ModelsWithLinksMixin

Check either internal or external urls for status 200.

class Statistic[source]

Bases: NamedTuple

total: int[source]
ok: int[source]
nok: int[source]
error: int[source]
duration: float[source]
property internal_only: bool[source]
property external_only: bool[source]
filter_urls(urls: Sequence[str]) Sequence[str][source]
find_urls() Iterator[tuple[str, str, Sequence[str]]][source]
url_list_generator() Iterator[LinkCheck][source]
unhealthy_urls() tuple[Statistic, Sequence[LinkCheck]][source]

We check the urls in the backend, unless they are internal. In that case, we can not do that since we do not have async support. Otherwise returns the LinkChecks with empty statistics for use in the frontend.