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

Commit f25f638

Browse files
committed
Lint
1 parent 3ff3dfe commit f25f638

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

docs/sample_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ uploads_path: "DATADIR/uploads"
805805
# # Directory in which Synapse will try to find the HTML files to serve to the
806806
# # user when trying to renew an account. Optional, defaults to
807807
# # synapse/res/templates.
808-
# template_dir: "res/templates"
808+
# template_dir: "res/templates"
809809
# # HTML to be displayed to the user after they successfully renewed their
810810
# # account. Optional.
811811
# account_renewed_html_path: "account_renewed.html"

synapse/config/registration.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
# limitations under the License.
1515

1616
import os
17-
import pkg_resources
18-
1917
from distutils.util import strtobool
2018

19+
import pkg_resources
20+
2121
from synapse.config._base import Config, ConfigError
2222
from synapse.types import RoomAlias
2323
from synapse.util.stringutils import random_string_with_symbols
@@ -54,26 +54,21 @@ def __init__(self, config, synapse_config):
5454
template_dir = pkg_resources.resource_filename("synapse", "res/templates")
5555

5656
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"])
6058

6159
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"
6461
)
6562
else:
6663
self.account_renewed_html_content = (
6764
"<html><body>Your account has been successfully renewed.</body><html>"
6865
)
6966

7067
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"])
7469

7570
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"
7772
)
7873
else:
7974
self.invalid_token_html_content = (
@@ -184,7 +179,7 @@ def generate_config_section(self, generate_secrets=False, **kwargs):
184179
# # Directory in which Synapse will try to find the HTML files to serve to the
185180
# # user when trying to renew an account. Optional, defaults to
186181
# # synapse/res/templates.
187-
# template_dir: "res/templates"
182+
# template_dir: "res/templates"
188183
# # HTML to be displayed to the user after they successfully renewed their
189184
# # account. Optional.
190185
# account_renewed_html_path: "account_renewed.html"

synapse/rest/client/v2_alpha/account_validity.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def on_GET(self, request):
5252
renewal_token = request.args[b"token"][0]
5353

5454
token_valid = yield self.account_activity_handler.renew_account(
55-
renewal_token.decode("utf8"),
55+
renewal_token.decode("utf8")
5656
)
5757

5858
if token_valid:
@@ -64,9 +64,7 @@ def on_GET(self, request):
6464

6565
request.setResponseCode(status_code)
6666
request.setHeader(b"Content-Type", b"text/html; charset=utf-8")
67-
request.setHeader(
68-
b"Content-Length", b"%d" % (len(response),)
69-
)
67+
request.setHeader(b"Content-Length", b"%d" % (len(response),))
7068
request.write(response.encode("utf8"))
7169
finish_request(request)
7270
defer.returnValue(None)

0 commit comments

Comments
 (0)