Skip to content

context_processors

django_spire.knowledge.context_processors

django_spire_knowledge

Source code in django_spire/knowledge/context_processors.py
def django_spire_knowledge(request: WSGIRequest) -> dict[str, Any]:
    if not request.user.is_authenticated:
        return {}

    return {
        'collection_tree_json': Collection.services.transformation.to_hierarchy_json(
            request=request,
        )
    }