reg/events.py
changeset 98 1af134a1e53d
parent 84 bb6a1bd4b3f8
equal deleted inserted replaced
97:87d522d28a28 98:1af134a1e53d
    98     """
    98     """
    99 
    99 
   100     new_password = gen_key(10)
   100     new_password = gen_key(10)
   101     user.set_password(new_password)
   101     user.set_password(new_password)
   102     user.save()
   102     user.save()
       
   103 
       
   104     subject = "Password on FOSSEE registration"
       
   105     message = """
       
   106     Dear %s,
       
   107 
       
   108     Your new password is "%s".
       
   109     This password can be changed using the "change password" link available in "My Profile" page after you login.
       
   110  
       
   111     Please mail your queries and complaints to admin@fossee.in.
       
   112 
       
   113     If you have not registered at fossee, please ignore this mail.
       
   114 
       
   115     Regards,
       
   116     FOSSEE Team
       
   117     """%(user.get_full_name(), new_password)
       
   118 
       
   119     send_mail(subject, message, "admin@fossee.in", [user.email])
       
   120 
   103     return new_password
   121     return new_password
   104 
   122 
   105 def change_password(user, new_password):
   123 def change_password(user, new_password):
   106     """ for now just set the password and be done with it.
   124     """ for now just set the password and be done with it.
   107     later on, if we want to do something else also then we can add them here.
   125     later on, if we want to do something else also then we can add them here.