python: Reformat with Black, except quotes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:19:30 -08:00
committed by Tim Abbott
parent 5028c081cb
commit 11741543da
817 changed files with 44952 additions and 24860 deletions

View File

@@ -16,6 +16,7 @@ def get_forward_address() -> str:
except (configparser.NoSectionError, configparser.NoOptionError):
return ""
def set_forward_address(forward_address: str) -> None:
config = configparser.ConfigParser()
config.read(settings.FORWARD_ADDRESS_CONFIG_FILE)
@@ -27,6 +28,7 @@ def set_forward_address(forward_address: str) -> None:
with open(settings.FORWARD_ADDRESS_CONFIG_FILE, "w") as cfgfile:
config.write(cfgfile)
class EmailLogBackEnd(EmailBackend):
@staticmethod
def log_email(email: EmailMultiAlternatives) -> None:
@@ -67,7 +69,9 @@ class EmailLogBackEnd(EmailBackend):
# Here, we replace the email addresses used in development
# with chat.zulip.org, so that web email providers like Gmail
# will be able to fetch the illustrations used in the emails.
html_alternative[0] = html_alternative[0].replace(localhost_email_images_base_uri, czo_email_images_base_uri)
html_alternative[0] = html_alternative[0].replace(
localhost_email_images_base_uri, czo_email_images_base_uri
)
email_message.alternatives[0] = tuple(html_alternative)
email_message.to = [get_forward_address()]