[Update] 修改只有local用户需要发送创建成功邮件、发送密码过期邮件;

This commit is contained in:
Bai
2020-03-13 12:33:09 +08:00
parent e38b113d7e
commit 04945809a5
3 changed files with 10 additions and 3 deletions

View File

@@ -596,6 +596,11 @@ class User(AuthMixin, TokenMixin, RoleMixin, MFAMixin, AbstractUser):
user.save()
user.groups.add(UserGroup.initial())
def can_send_created_mail(self):
if self.email and self.source == self.SOURCE_LOCAL:
return True
return False
@classmethod
def generate_fake(cls, count=100):
from random import seed, choice