From 1803f2b0acf0a30d81c59eb1e45bc674f04a1410 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Tue, 28 Oct 2025 15:51:34 +0000 Subject: [PATCH] For branding: use none instead of undefined --- crates/templates/src/context/branding.rs | 6 +++--- templates/components/footer.html | 10 +++++----- templates/pages/register/password.html | 2 +- templates/pages/upstream_oauth2/do_register.html | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/templates/src/context/branding.rs b/crates/templates/src/context/branding.rs index eb7e3546a..15932567f 100644 --- a/crates/templates/src/context/branding.rs +++ b/crates/templates/src/context/branding.rs @@ -58,9 +58,9 @@ impl Object for SiteBranding { fn get_value(self: &Arc, name: &Value) -> Option { match name.as_str()? { "server_name" => Some(self.server_name.clone().into()), - "policy_uri" => self.policy_uri.clone().map(Value::from), - "tos_uri" => self.tos_uri.clone().map(Value::from), - "imprint" => self.imprint.clone().map(Value::from), + "policy_uri" => Some(Value::from(self.policy_uri.clone())), + "tos_uri" => Some(Value::from(self.tos_uri.clone())), + "imprint" => Some(Value::from(self.imprint.clone())), _ => None, } } diff --git a/templates/components/footer.html b/templates/components/footer.html index 60a788859..28f1a7ec9 100644 --- a/templates/components/footer.html +++ b/templates/components/footer.html @@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details. -#}
- {%- if branding.policy_uri is defined or branding.tos_uri is defined -%} + {%- if branding.policy_uri is not none or branding.tos_uri is not none -%} {%- endif -%} - {%- if branding.imprint is defined -%} + {%- if branding.imprint is not none -%}

{{ branding.imprint }}

{%- endif -%}
diff --git a/templates/pages/register/password.html b/templates/pages/register/password.html index a4c585409..82aa763fd 100644 --- a/templates/pages/register/password.html +++ b/templates/pages/register/password.html @@ -49,7 +49,7 @@ Please see LICENSE files in the repository root for full details. {% endcall %} - {% if branding.tos_uri is defined %} + {% if branding.tos_uri is not none %} {% 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") %}
diff --git a/templates/pages/upstream_oauth2/do_register.html b/templates/pages/upstream_oauth2/do_register.html index 6d5db9808..2a57a6aca 100644 --- a/templates/pages/upstream_oauth2/do_register.html +++ b/templates/pages/upstream_oauth2/do_register.html @@ -175,7 +175,7 @@ Please see LICENSE files in the repository root for full details.
{% endif %} - {% if branding.tos_uri is defined %} + {% if branding.tos_uri is not none %} {% 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") %}