Skip to content

Wagtail hooks



exclude_fund_pages(parent_page, pages, request)
Source code in hypha/home/
def exclude_fund_pages(parent_page, pages, request):
    # Don't allow editors to access the Apply pages in the explorer unless they know whats up
    if not request.user.is_superuser:
        pages = pages.not_descendant_of(ApplyHomePage.objects.first(), inclusive=True)

    return pages


hide_explorer_menu_item_from_frank(request, menu_items)
Source code in hypha/home/
def hide_explorer_menu_item_from_frank(request, menu_items):
    if not request.user.is_superuser:
        groups = list(request.user.groups.all())
        # If the user is only in the staff group they should never see the explorer menu item
        if len(groups) == 1 and groups[0].name == STAFF_GROUP_NAME:
            menu_items[:] = [item for item in menu_items if != "explorer"]