better reset password email

This commit is contained in:
j 2010-12-25 15:42:51 +05:30
parent 258675f9eb
commit 70c0a5a682
2 changed files with 6 additions and 11 deletions

View file

@ -1,12 +1,7 @@
Somebody tried to reset your password for {{sitename}}. To reset your password, please use the following token:
If it is you, and still want to reset your password.
Use this token
{{token}} {{token}}
to reset your password. If you do not want to reset your password, no further action is required.
If you did not request a password, you can safely ignore this e-mail. {{sitename}} - {{url}}
{{sitename}}

View file

@ -272,7 +272,7 @@ def requestToken(request):
'sitename': settings.SITENAME, 'sitename': settings.SITENAME,
}) })
message = template.render(context) message = template.render(context)
subject = '%s password reset' % settings.SITENAME subject = '%s - Reset Password' % settings.SITENAME
user.email_user(subject, message) user.email_user(subject, message)
response = json_response({ response = json_response({
'username': user.username 'username': user.username
@ -309,7 +309,7 @@ def findUser(request):
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
response = json_response(status=200, text='ok') response = json_response(status=200, text='ok')
if data['key'] == 'email': if data['key'] == 'email':
response['data']['users'] = [u.email for u in User.objects.filter(email__iexact=data['value'])] response['data']['users'] = [u.username for u in User.objects.filter(email__iexact=data['value'])]
else: else:
response['data']['users'] = [u.username for u in User.objects.filter(username__iexact=data['value'])] response['data']['users'] = [u.username for u in User.objects.filter(username__iexact=data['value'])]
return render_to_json_response(response) return render_to_json_response(response)