signals.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:cyphon 作者: dunbarcyber 项目源码 文件源码
def send_comment_notification(sender, instance, created, **kwargs):
    """Email relevant users when a new |Comment| is saved."""

    # email relevant users if a comment is created
    if created and emails_enabled():
        for user in instance.get_other_contributors():
            email_message = compose_comment_email(instance, user)
            try:
                email_message.send()
            except smtplib.SMTPAuthenticationError as error:
                _LOGGER.error('An error occurred when sending an '
                              'email notification: %s', error)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号