#NEWLINE# def save( self , domain_override = None , subject_template_name = 'registration/password_reset_subject.txt' , email_template_name = 'registration/password_reset_email.html' , use_https = False , token_generator = default_token_generator , from_email = None , request = None ) : #NEWLINE# #INDENT# '\n        Generates a one-use only link for resetting password and sends to the\n        user.\n        ' #NEWLINE# from django.core.mail import send_mail #NEWLINE# for user in self . users_cache : #NEWLINE# #INDENT# if ( not domain_override ) : #NEWLINE# #INDENT# current_site = get_current_site ( request ) #NEWLINE# site_name = current_site . name #NEWLINE# domain = current_site . domain #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# site_name = domain = domain_override #NEWLINE# #UNINDENT# c = { #NEWLINE# #INDENT# 'email' : user . email , #NEWLINE# 'domain' : domain , #NEWLINE# 'site_name' : site_name , #NEWLINE# 'uid' : int_to_base36 ( user . id ) , #NEWLINE# 'user' : user , #NEWLINE# 'token' : token_generator . make_token ( user ) , #NEWLINE# 'protocol' : ( ( use_https and 'https' ) or 'http' ) , #NEWLINE# #UNINDENT# } #NEWLINE# subject = loader . render_to_string ( subject_template_name , c ) #NEWLINE# subject = '' . join ( subject . splitlines ( ) ) #NEWLINE# email = loader . render_to_string ( email_template_name , c ) #NEWLINE# send_mail ( subject , email , self , [ user . email ] )