mirror of https://github.com/jumpserver/jumpserver
perf: 优化获取邮箱后缀代码位置
parent
60e4b19d07
commit
e45676edc4
|
@ -240,13 +240,12 @@ def validate_email(addr):
|
|||
|
||||
|
||||
def construct_user_email(username, email, email_suffix=''):
|
||||
email_suffix = email_suffix or settings.EMAIL_SUFFIX
|
||||
|
||||
email = validate_email(email)
|
||||
if not email:
|
||||
email = validate_email(username)
|
||||
|
||||
if not email:
|
||||
email_suffix = email_suffix or settings.EMAIL_SUFFIX
|
||||
email = f'{username}@{email_suffix}'
|
||||
return email
|
||||
|
||||
|
|
Loading…
Reference in New Issue