forked from 0x2620/pandora
better reset password email
This commit is contained in:
parent
258675f9eb
commit
70c0a5a682
2 changed files with 6 additions and 11 deletions
|
@ -1,12 +1,7 @@
|
|||
Somebody tried to reset your password for {{sitename}}.
|
||||
|
||||
If it is you, and still want to reset your password.
|
||||
Use this token
|
||||
To reset your password, please use the following 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}}
|
||||
{{sitename}} - {{url}}
|
||||
|
|
|
@ -272,7 +272,7 @@ def requestToken(request):
|
|||
'sitename': settings.SITENAME,
|
||||
})
|
||||
message = template.render(context)
|
||||
subject = '%s password reset' % settings.SITENAME
|
||||
subject = '%s - Reset Password' % settings.SITENAME
|
||||
user.email_user(subject, message)
|
||||
response = json_response({
|
||||
'username': user.username
|
||||
|
@ -309,7 +309,7 @@ def findUser(request):
|
|||
data = json.loads(request.POST['data'])
|
||||
response = json_response(status=200, text='ok')
|
||||
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:
|
||||
response['data']['users'] = [u.username for u in User.objects.filter(username__iexact=data['value'])]
|
||||
return render_to_json_response(response)
|
||||
|
|
Loading…
Reference in a new issue