Skip to content

Commit

Permalink
perf: 优化获取邮箱后缀代码位置
Browse files Browse the repository at this point in the history
  • Loading branch information
O-Jiangweidong authored and BaiJiangJie committed Mar 11, 2024
1 parent 60e4b19 commit e45676e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/users/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e45676e

Please sign in to comment.