#NEWLINE# def save( self , commit = True ) : #NEWLINE# #INDENT# '\n        Save the model instance with the correct Auth Group based on the user_level question\n        ' #NEWLINE# instance = super ( UserCreationForm , self ) . save ( commit = commit ) #NEWLINE# random_password = '' . join ( ( random . choice ( ( string . ascii_uppercase + string . digits ) ) for x in range ( 32 ) ) ) #NEWLINE# instance . set_password ( random_password ) #NEWLINE# instance . save ( ) #NEWLINE# email_form = PasswordResetForm ( { #NEWLINE# #INDENT# 'email' : self . cleaned_data [ 'email' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# email_form . is_valid ( ) #NEWLINE# email_form . save ( email_template_name = 'accounts/welcome_email.html' ) #NEWLINE# return instance