# HG changeset patch # User nishanth # Date 1272020742 -19800 # Node ID 1af134a1e53dad638dd10ac3988022ef0d3af7ad # Parent 87d522d28a28da011562935c49676726104331c2 now an email will be sent to user after he resets his password. diff -r 87d522d28a28 -r 1af134a1e53d reg/events.py --- a/reg/events.py Sat Apr 17 14:59:58 2010 +0530 +++ b/reg/events.py Fri Apr 23 16:35:42 2010 +0530 @@ -100,6 +100,24 @@ new_password = gen_key(10) user.set_password(new_password) user.save() + + subject = "Password on FOSSEE registration" + message = """ + Dear %s, + + Your new password is "%s". + This password can be changed using the "change password" link available in "My Profile" page after you login. + + Please mail your queries and complaints to admin@fossee.in. + + If you have not registered at fossee, please ignore this mail. + + Regards, + FOSSEE Team + """%(user.get_full_name(), new_password) + + send_mail(subject, message, "admin@fossee.in", [user.email]) + return new_password def change_password(user, new_password): diff -r 87d522d28a28 -r 1af134a1e53d reg/views.py --- a/reg/views.py Sat Apr 17 14:59:58 2010 +0530 +++ b/reg/views.py Fri Apr 23 16:35:42 2010 +0530 @@ -224,6 +224,7 @@ email = form.cleaned_data['email'] user = User.objects.get(email__iexact=email) new_password = reg_events.reset_password(user) + reg_events.mail_password(user, new_password) return render_to_response('password_reset.html', {'user':user, 'new_password':new_password}) else: return render_to_response('password_reset.html', {'user':user, 'form':form}) diff -r 87d522d28a28 -r 1af134a1e53d templates/password_reset.html --- a/templates/password_reset.html Sat Apr 17 14:59:58 2010 +0530 +++ b/templates/password_reset.html Fri Apr 23 16:35:42 2010 +0530 @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} {% if new_password %} - Your password is "{{ new_password }}". This will be sent to your email id when app is on FOSSEE.
+ Your password has been sent to your email address.
Click here to return to home page. {% else %}