diff --git a/django_app/redbox_app/templates/homepage.html b/django_app/redbox_app/templates/homepage.html index bb0c84f9..6b16db7d 100644 --- a/django_app/redbox_app/templates/homepage.html +++ b/django_app/redbox_app/templates/homepage.html @@ -1,7 +1,7 @@ {% set pageTitle = "" %} {% extends "base.html" %} {% from "macros/govuk-button.html" import govukButton %} -{% set cspNonce = request.csp_nonce %} +{% set cspNonce = request.csp_nonce|default('') %} {% block content %} diff --git a/django_app/redbox_app/templates/macros/iai-top-nav.html b/django_app/redbox_app/templates/macros/iai-top-nav.html index 1e3af38e..fd89c2db 100644 --- a/django_app/redbox_app/templates/macros/iai-top-nav.html +++ b/django_app/redbox_app/templates/macros/iai-top-nav.html @@ -3,8 +3,10 @@ id="topNav" data-product_name="{{ product_name }}" data-menu_items="{{ menu_items | tojson if menu_items is not none else '[]' }}" - data-user_items="{{ user_items | tojson if user_items is not none else '{}' }}" - data-phase="{{ phase }}" + {% if user_items %} + data-user_items="{{ user_items | tojson if user_items is not none else '{}' }}" + {% endif %} + data-phase="{{ phase }}" data-home_path="{{ home_path }}" >