更改django-allauth电子邮件验证行为 [英] Change django-allauth email verification behaivior
问题描述
Django内置了用户模型 is_active
字段。我假设django-allauth在成功通过电子邮件验证后将此字段设置为True。
Django has builtin User model is_active
field. I assume that django-allauth sets this field to True after successful e-mail verification.
我将手动启用用户并将此字段更改为 true。通过Django管理界面代替。
是否可以从django-allauth更改此行为?
I would manually enable the user and change this field to "true" via the Django admin interface instead. Is it possible to change this behavior from django-allauth?
推荐答案
is_active 就像您提到的那样,code>用于确定其是否为活动帐户,可以将其翻转为
False
而不是删除帐户。但是我认为all-auth不会使用此值做任何事情,当您创建 User $ c $时,它会自动设置为
True
c>对象。
is_active
is, like you mentioned, used to determine whether its an active account, and can be flipped to False
instead of deleting the acccount. But I don't think all-auth does anything with this value, it is automatically set to True
when you create a User
object.
您要查找的内容位于单独的表中,通常为 email_addresses。这将显示已验证哪些电子邮件地址。
What you are looking for is in a separate table, usually "email_addresses". This will show which email addresses have been verified.
这篇关于更改django-allauth电子邮件验证行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!