models.py 文件源码

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

项目:opencon-2016-app-code 作者: sparcopen 项目源码 文件源码
def invite(self):
        """
        Send invite mail to application email address.
        """
        if not settings.REVIEWER_MAIL_ENABLED:
            return

        context = {
            "user": self,
            "link": "{}{}".format(
                settings.BASE_URL,
                reverse("rating:rate", args=[self.uuid])
            )
        }

        subject = render_to_string(
            "rating/email/invite.subject", context
        ).strip()
        message = render_to_string("rating/email/invite.message", context)

        send_mail(
            subject,
            message,
            settings.FROM_MAIL,
            [self.email],
            fail_silently=False
        )
        self.invitation_sent = True
        self.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号