#NEWLINE# @ classmethod #NEWLINE# def create_account( cls , params ) : #NEWLINE# #INDENT# ' Create auth user instance with data from :params:.\n\n        Used by both Token and Ticket-based auths to register a user (\n        called from views).\n        ' #NEWLINE# user_params = dictset ( params ) . subset ( [ 'username' , 'email' , 'password' ] ) #NEWLINE# try : #NEWLINE# #INDENT# return cls . get_or_create ( email = user_params [ 'email' ] , defaults = user_params ) #NEWLINE# #UNINDENT# except JHTTPBadRequest : #NEWLINE# #INDENT# raise JHTTPBadRequest ( 'Failed to create account.' )