kopia lustrzana https://github.com/snarfed/bridgy-fed
switch to Gmail SMTP, other minor tweaks
rodzic
def8c3d535
commit
b543fdb1d5
|
@ -63,7 +63,7 @@ DOMAIN_BLOCKLIST = (
|
||||||
'twitter.com',
|
'twitter.com',
|
||||||
)
|
)
|
||||||
|
|
||||||
SMTP_HOST = 'mail.gandi.net'
|
SMTP_HOST = 'smtp.gmail.com'
|
||||||
SMTP_PORT = 587
|
SMTP_PORT = 587
|
||||||
|
|
||||||
# populated in models.reset_protocol_properties
|
# populated in models.reset_protocol_properties
|
||||||
|
|
|
@ -372,7 +372,7 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
|
||||||
|
|
||||||
add(self.enabled_protocols, to_proto.LABEL)
|
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)
|
logger.info(msg)
|
||||||
common.email_me(msg)
|
common.email_me(msg)
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
|
||||||
|
|
||||||
remove(self.enabled_protocols, to_proto.LABEL)
|
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)
|
logger.info(msg)
|
||||||
common.email_me(msg)
|
common.email_me(msg)
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,7 @@ class Protocol:
|
||||||
label = domain.removesuffix(common.SUPERDOMAIN)
|
label = domain.removesuffix(common.SUPERDOMAIN)
|
||||||
return PROTOCOLS.get(label)
|
return PROTOCOLS.get(label)
|
||||||
|
|
||||||
|
# TODO: redesign this API to require user
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_enabled_to(from_cls, to_cls, user=None):
|
def is_enabled_to(from_cls, to_cls, user=None):
|
||||||
"""Returns True if two protocols, and optionally a user, can be bridged.
|
"""Returns True if two protocols, and optionally a user, can be bridged.
|
||||||
|
|
Ładowanie…
Reference in New Issue