root: fix passbook.footer_links not being rendered
This commit is contained in:
@ -3,11 +3,12 @@ import os
|
||||
from collections.abc import Mapping
|
||||
from contextlib import contextmanager
|
||||
from glob import glob
|
||||
from typing import Any
|
||||
from typing import Any, Dict
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import yaml
|
||||
from django.conf import ImproperlyConfigured
|
||||
from django.http import HttpRequest
|
||||
from structlog import get_logger
|
||||
|
||||
SEARCH_PATHS = ["passbook/lib/default.yml", "/etc/passbook/config.yml", ""] + glob(
|
||||
@ -18,6 +19,12 @@ ENV_PREFIX = "PASSBOOK"
|
||||
ENVIRONMENT = os.getenv(f"{ENV_PREFIX}_ENV", "local")
|
||||
|
||||
|
||||
def context_processor(request: HttpRequest) -> Dict[str, Any]:
|
||||
"""Context Processor that injects config object into every template"""
|
||||
kwargs = {"config": CONFIG.raw}
|
||||
return kwargs
|
||||
|
||||
|
||||
class ConfigLoader:
|
||||
"""Search through SEARCH_PATHS and load configuration. Environment variables starting with
|
||||
`ENV_PREFIX` are also applied.
|
||||
|
@ -18,7 +18,9 @@ log_level: warning
|
||||
error_reporting: false
|
||||
|
||||
passbook:
|
||||
# Optionally add links to the footer on the login page
|
||||
footer_links:
|
||||
# Optionally add links to the footer on the login page
|
||||
- name: Documentation
|
||||
href: https://passbook.beryju.org/
|
||||
# - name: test
|
||||
# href: https://test
|
||||
|
Reference in New Issue
Block a user