Use a demo site banner to avoid confusion

This commit is contained in:
Neil Martinsen-Burrell 2022-10-28 14:25:23 -05:00
parent 4722ec43e8
commit 2cc799bb65
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
3 changed files with 29 additions and 1 deletions

View file

@ -21,3 +21,13 @@ def canonical_path(request):
template itself, so we do it here and pass the information on.
"""
return {"CANONICAL_PATH": request.build_absolute_uri(request.path)}
def is_demo_site(request):
"""Add a boolean if this is a demo site.
To be able to render or not our "demo site" banner, we need a context
variable for the template that indicates if this banner should or
should not appear.
"""
return {"IS_DEMO_SITE": settings.IS_DEMO_SITE}