Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Centralise the custom template directory #10596

Merged
merged 22 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Lint
  • Loading branch information
babolivier committed Aug 13, 2021
commit d2ee09cbf35a70529cd9f2752cfb58377edc1479
6 changes: 4 additions & 2 deletions synapse/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,9 @@ class LimitRemoteRoomsConfig:
self.next_link_domain_whitelist = set(next_link_domain_whitelist)

templates_config = config.get("templates", {})
self.custom_template_directory = templates_config.get("custom_template_directory")
self.custom_template_directory = templates_config.get(
"custom_template_directory"
)

def has_tls_listener(self) -> bool:
return any(listener.tls for listener in self.listeners)
Expand Down Expand Up @@ -1287,7 +1289,7 @@ def generate_config_section(
# all domains.
#
#next_link_domain_whitelist: ["matrix.org"]

# Templates to use when generating email or HTML page contents.
#
templates:
Expand Down
5 changes: 3 additions & 2 deletions synapse/module_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self, hs: "HomeServer", auth_handler):
self._state = hs.get_state_handler()
self._clock: Clock = hs.get_clock()
self._send_email_handler = hs.get_send_email_handler()
self.custom_template_dir =hs.config.server.custom_template_directory
self.custom_template_dir = hs.config.server.custom_template_directory

try:
app_name = self._hs.config.email_app_name
Expand Down Expand Up @@ -679,7 +679,8 @@ def read_templates(
the filenames parameter.
"""
return self._hs.config.read_templates(
filenames, [self.custom_template_dir, custom_template_directory],
filenames,
[self.custom_template_dir, custom_template_directory],
)


Expand Down