mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-31 15:11:27 +00:00
perf: 优化获取邮箱后缀代码位置
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user