From b543fdb1d58e5f39c0aeb6c2df8d7a163b5f3be6 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Wed, 24 Apr 2024 14:26:20 -0700 Subject: [PATCH] switch to Gmail SMTP, other minor tweaks --- common.py | 2 +- models.py | 4 ++-- protocol.py | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common.py b/common.py index 99cf3a0..d2fa313 100644 --- a/common.py +++ b/common.py @@ -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 diff --git a/models.py b/models.py index 54f961d..52bf9a2 100644 --- a/models.py +++ b/models.py @@ -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) diff --git a/protocol.py b/protocol.py index 094e351..67b697d 100644 --- a/protocol.py +++ b/protocol.py @@ -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.