src/url_checks/checks.py
def _check_path_tree(url_tree, namespace=None):
    """Provide error for each URI pattern missing a / at end"""
    errors = []
    for path in url_tree:
        if isinstance(path, URLPattern):
            msg = _check_path(path, namespace)
            if msg:
                errors.append(msg)
        elif isinstance(path, URLResolver):
            new_namespace = (
                f"{namespace}:{path.namespace}"
                if namespace and path.namespace
                else (path.namespace or namespace)
            )
            msg = _check_resolver(path, namespace)
            if msg:
                errors.append(msg)
            errors.extend(_check_path_tree(path.url_patterns, new_namespace))
        else:
            errors.append(MESSAGES.URLCONF_UNKNOWN_TYPE())
    return errors
Provide error for each URI pattern missing a / at end
Provide error for each URI pattern missing a / at end
Provide error for each URI pattern missing a / at end
def _check_path_tree(url_tree, namespace=None):
    errors = []
    for path in url_tree:
        if isinstance(path, URLPattern):
            msg = _check_path(path, namespace)
            if msg:
                errors.append(msg)
        elif isinstance(path, URLResolver):
            new_namespace = (
                f"{namespace}:{path.namespace}"
                if namespace and path.namespace
                else (path.namespace or namespace)
            )
            msg = _check_resolver(path, namespace)
            if msg:
                errors.append(msg)
            errors.extend(_check_path_tree(path.url_patterns, new_namespace))
        else:
            errors.append(MESSAGES.URLCONF_UNKNOWN_TYPE())
    return errors
def _check_path_tree ( url_tree , namespace = None ) : errors = [ ] for path in url_tree : if isinstance ( path , URLPattern ) : msg = _check_path ( path , namespace ) if msg : errors . append ( msg ) elif isinstance ( path , URLResolver ) : new_namespace = ( f"{namespace}:{path.namespace}" if namespace and path . namespace else ( path . namespace or namespace ) ) msg = _check_resolver ( path , namespace ) if msg : errors . append ( msg ) errors . extend ( _check_path_tree ( path . url_patterns , new_namespace ) ) else : errors . append ( MESSAGES . URLCONF_UNKNOWN_TYPE ( ) ) return errors
Provide error for each URI pattern missing a / at end
Provide error for each URI pattern missing a / at end
"""Provide error for each URI pattern missing a / at end"""
url_tree
namespace