【发布时间】:2015-09-28 06:48:36
【问题描述】:
我正在使用 python social auth 进行登录。创建用户后,我想向用户发送电子邮件。为此,我正在编写一个自定义管道
def send_confirmation_email(strategy, details, response, user=None, *args, **kwargs):
if user:
if kwargs['is_new']:
template = "email/social_registration_confirm.html"
subject = "Account Confirmation"
email = user.email
print(user.username)
username = user.username
kwargs.update(subject=subject, email=email, username=username)
notification_email.delay(template, **kwargs)
我正在使用celery 发送电子邮件。当我发送电子邮件时,它给我错误提示 <UserSocialAuth: some_username> is not JSON serializable
为什么我会收到此错误。 notification_email 适用于其他电子邮件发送功能。
需要建议。谢谢
【问题讨论】: