Skip to content

Commit

Permalink
Fix reset email message
Browse files Browse the repository at this point in the history
  • Loading branch information
xiez committed Jan 17, 2017
1 parent e906778 commit 622fe27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion seahub/views/sysadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ def user_reset(request, email):
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}
{'passwd': new_password, 'user': contact_email}
messages.success(request, msg)
except Exception, e:
logger.error(str(e))
Expand Down
2 changes: 1 addition & 1 deletion tests/seahub/views/sysadmin/test_user_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_can_send_reset_email_to_contact_email(self):
reverse('user_reset', args=[self.user.email])
)
self.assertEqual(302, resp.status_code)
assert 'email has been sent' in parse_cookie(resp.cookies)['messages']
assert 'email has been sent to contact@mail.com' in parse_cookie(resp.cookies)['messages']

self.assertEqual(len(mail.outbox), 1)
assert mail.outbox[0].to[0] != self.user.username
Expand Down

0 comments on commit 622fe27

Please sign in to comment.