switch to Gmail SMTP, other minor tweaks

pull/977/head
Ryan Barrett 2024-04-24 14:26:20 -07:00
rodzic def8c3d535
commit b543fdb1d5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
3 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -63,7 +63,7 @@ DOMAIN_BLOCKLIST = (
'twitter.com',
)
SMTP_HOST = 'mail.gandi.net'
SMTP_HOST = 'smtp.gmail.com'
SMTP_PORT = 587
# populated in models.reset_protocol_properties

Wyświetl plik

@ -372,7 +372,7 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
add(self.enabled_protocols, to_proto.LABEL)
msg = f'Enabled {to_proto.LABEL} for {self.key} : {self.user_page_path()}'
msg = f'Enabled {to_proto.LABEL} for {self.key.id()} : {self.user_page_path()}'
logger.info(msg)
common.email_me(msg)
@ -391,7 +391,7 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
remove(self.enabled_protocols, to_proto.LABEL)
msg = f'Disabled {to_proto.LABEL} for {self.key} : {self.user_page_path()}'
msg = f'Disabled {to_proto.LABEL} for {self.key.id()} : {self.user_page_path()}'
logger.info(msg)
common.email_me(msg)

Wyświetl plik

@ -143,6 +143,7 @@ class Protocol:
label = domain.removesuffix(common.SUPERDOMAIN)
return PROTOCOLS.get(label)
# TODO: redesign this API to require user
@classmethod
def is_enabled_to(from_cls, to_cls, user=None):
"""Returns True if two protocols, and optionally a user, can be bridged.