|
14 | 14 | # limitations under the License. |
15 | 15 |
|
16 | 16 | import os |
17 | | -import pkg_resources |
18 | | - |
19 | 17 | from distutils.util import strtobool |
20 | 18 |
|
| 19 | +import pkg_resources |
| 20 | + |
21 | 21 | from synapse.config._base import Config, ConfigError |
22 | 22 | from synapse.types import RoomAlias |
23 | 23 | from synapse.util.stringutils import random_string_with_symbols |
@@ -54,26 +54,21 @@ def __init__(self, config, synapse_config): |
54 | 54 | template_dir = pkg_resources.resource_filename("synapse", "res/templates") |
55 | 55 |
|
56 | 56 | if "account_renewed_html_path" in config: |
57 | | - file_path = os.path.join( |
58 | | - template_dir, config["account_renewed_html_path"], |
59 | | - ) |
| 57 | + file_path = os.path.join(template_dir, config["account_renewed_html_path"]) |
60 | 58 |
|
61 | 59 | self.account_renewed_html_content = self.read_file( |
62 | | - file_path, |
63 | | - "account_validity.account_renewed_html_path", |
| 60 | + file_path, "account_validity.account_renewed_html_path" |
64 | 61 | ) |
65 | 62 | else: |
66 | 63 | self.account_renewed_html_content = ( |
67 | 64 | "<html><body>Your account has been successfully renewed.</body><html>" |
68 | 65 | ) |
69 | 66 |
|
70 | 67 | if "invalid_token_html_path" in config: |
71 | | - file_path = os.path.join( |
72 | | - template_dir, config["invalid_token_html_path"], |
73 | | - ) |
| 68 | + file_path = os.path.join(template_dir, config["invalid_token_html_path"]) |
74 | 69 |
|
75 | 70 | self.invalid_token_html_content = self.read_file( |
76 | | - file_path, "account_validity.invalid_token_html_path", |
| 71 | + file_path, "account_validity.invalid_token_html_path" |
77 | 72 | ) |
78 | 73 | else: |
79 | 74 | self.invalid_token_html_content = ( |
@@ -184,7 +179,7 @@ def generate_config_section(self, generate_secrets=False, **kwargs): |
184 | 179 | # # Directory in which Synapse will try to find the HTML files to serve to the |
185 | 180 | # # user when trying to renew an account. Optional, defaults to |
186 | 181 | # # synapse/res/templates. |
187 | | - # template_dir: "res/templates" |
| 182 | + # template_dir: "res/templates" |
188 | 183 | # # HTML to be displayed to the user after they successfully renewed their |
189 | 184 | # # account. Optional. |
190 | 185 | # account_renewed_html_path: "account_renewed.html" |
|
0 commit comments