1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

Use contact email in password resetting

This commit is contained in:
zhengxie
2017-01-16 15:46:00 +08:00
parent e04005770e
commit df70fd1b5e
2 changed files with 19 additions and 1 deletions

View File

@@ -920,7 +920,8 @@ def user_reset(request, email):
if IS_EMAIL_CONFIGURED:
if SEND_EMAIL_ON_RESETTING_USER_PASSWD:
try:
send_user_reset_email(request, user.email, new_password)
contact_email = Profile.objects.get_contact_email_by_user(user.email)
send_user_reset_email(request, contact_email, new_password)
msg = _('Successfully reset password to %(passwd)s, an email has been sent to %(user)s.') % \
{'passwd': new_password, 'user': user.email}
messages.success(request, msg)