#NEWLINE# @ classmethod #NEWLINE# def create( cls , request = None , **kwargs ) : #NEWLINE# #INDENT# create_email = kwargs . pop ( 'create_email' , True ) #NEWLINE# confirm_email = kwargs . pop ( 'confirm_email' , None ) #NEWLINE# account = cls ( ** kwargs ) #NEWLINE# if ( 'language' not in kwargs ) : #NEWLINE# #INDENT# if ( request is None ) : #NEWLINE# #INDENT# account . language = settings . LANGUAGE_CODE #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# account . language = translation . get_language_from_request ( request , check_path = True ) #NEWLINE# #UNINDENT# #UNINDENT# account . save ( ) #NEWLINE# if ( create_email and account . user . email ) : #NEWLINE# #INDENT# kwargs = { #NEWLINE# #INDENT# 'primary' : True , #NEWLINE# #UNINDENT# } #NEWLINE# if ( confirm_email is not None ) : #NEWLINE# #INDENT# kwargs [ 'confirm' ] = confirm_email #NEWLINE# #UNINDENT# EmailAddress . objects . add_email ( account . user , account . user . email , ** kwargs ) #NEWLINE# #UNINDENT# return account