summary refs log tree commit diff
path: root/synapse/config/_base.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-02 06:15:53 -0400
committerGitHub <noreply@github.com>2020-10-02 11:15:53 +0100
commit34ff8da83b54024289f515c6d73e6b486574d699 (patch)
treebb7570650c3b3a54c5a6fe2263ec9a4e26dd0fb8 /synapse/config/_base.py
parentFix malformed log line in new federation "catch up" logic (#8442) (diff)
downloadsynapse-34ff8da83b54024289f515c6d73e6b486574d699.tar.xz
Convert additional templates to Jinja (#8444)
This converts a few more of our inline HTML templates to Jinja. This is somewhat part of #7280 and should make it a bit easier to customize these in the future.
Diffstat (limited to 'synapse/config/_base.py')
-rw-r--r--synapse/config/_base.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py
index 05a66841c3..85f65da4d9 100644
--- a/synapse/config/_base.py
+++ b/synapse/config/_base.py
@@ -242,12 +242,11 @@ class Config:
         env = jinja2.Environment(loader=loader, autoescape=autoescape)
 
         # Update the environment with our custom filters
-        env.filters.update(
-            {
-                "format_ts": _format_ts_filter,
-                "mxc_to_http": _create_mxc_to_http_filter(self.public_baseurl),
-            }
-        )
+        env.filters.update({"format_ts": _format_ts_filter})
+        if self.public_baseurl:
+            env.filters.update(
+                {"mxc_to_http": _create_mxc_to_http_filter(self.public_baseurl)}
+            )
 
         for filename in filenames:
             # Load the template