Skip to content

Commit adad551

Browse files
committed
templates: fix reliance on lax undefined behaviour
1 parent 9a5f2f5 commit adad551

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{{ captcha.head() }}
2929
</head>
3030
<body>
31-
<div class="layout-container{% if consent_page %} consent{% endif %}">
31+
<div class="layout-container{% if consent_page is defined %} consent{% endif %}">
3232
{% block content %}{% endblock content %}
3333
{% include "components/footer.html" %}
3434
</div>

templates/components/footer.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
-#}
88

99
<footer class="legal-footer">
10-
{%- if branding.policy_uri or branding.tos_uri -%}
10+
{%- if branding.policy_uri is defined or branding.tos_uri is defined -%}
1111
<nav>
12-
{%- if branding.policy_uri -%}
12+
{%- if branding.policy_uri is defined -%}
1313
<a href="{{ branding.policy_uri }}" referrerpolicy="no-referrer" title="{{ _('branding.privacy_policy.alt') }}" class="cpd-link" data-kind="primary">
1414
{{- _("branding.privacy_policy.link") -}}
1515
</a>
1616
{%- endif -%}
1717

18-
{%- if branding.policy_uri and branding.tos_uri -%}
18+
{%- if branding.policy_uri is defined and branding.tos_uri is defined -%}
1919
<div class="separator" aria-hidden="true"></div>
2020
{%- endif -%}
2121

22-
{%- if branding.tos_uri -%}
22+
{%- if branding.tos_uri is defined -%}
2323
<a href="{{ branding.tos_uri }}" referrerpolicy="no-referrer" title="{{ _('branding.terms_and_conditions.alt') }}" class="cpd-link" data-kind="primary">
2424
{{- _("branding.terms_and_conditions.link") -}}
2525
</a>
2626
{%- endif -%}
2727
</nav>
2828
{%- endif -%}
2929

30-
{%- if branding.imprint -%}
30+
{%- if branding.imprint is defined -%}
3131
<p class="imprint">{{ branding.imprint }}</p>
3232
{%- endif -%}
3333
</footer>

templates/pages/register/password.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ <h1 class="title">{{ _("mas.register.create_account.heading") }}</h1>
4949
<input {{ field.attributes(f) }} class="cpd-text-control" type="password" autocomplete="new-password" required />
5050
{% endcall %}
5151

52-
{% if branding.tos_uri %}
52+
{% if branding.tos_uri is defined %}
5353
{% call(f) field.field(label=_("mas.register.terms_of_service", tos_uri=branding.tos_uri), name="accept_terms", form_state=form, inline=true, class="my-4") %}
5454
<div class="cpd-form-inline-field-control">
5555
<div class="cpd-checkbox-container">

templates/pages/upstream_oauth2/do_register.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ <h3 class="provider">
175175
</div>
176176
{% endif %}
177177

178-
{% if branding.tos_uri %}
178+
{% if branding.tos_uri is defined %}
179179
{% call(f) field.field(label=_("mas.register.terms_of_service", tos_uri=branding.tos_uri), name="accept_terms", form_state=form_state, inline=true, class="my-4") %}
180180
<div class="cpd-form-inline-field-control">
181181
<div class="cpd-checkbox-container">

0 commit comments

Comments
 (0)