#NEWLINE# @ commit #NEWLINE# def run( self , **kwargs ) : #NEWLINE# #INDENT# ai = re . sub ( '\\s' , '' , str ( self [ 'active' ] ) ) #NEWLINE# kwargs [ 'active' ] = ( ai . lower ( ) in [ '' , 'y' , 'yes' , '1' , 'active' ] ) #NEWLINE# from flask_security.forms import ConfirmRegisterForm #NEWLINE# from werkzeug.datastructures import MultiDict #NEWLINE# form = ConfirmRegisterForm ( MultiDict ( kwargs ) , csrf_enabled = False ) #NEWLINE# if form . validate ( ) : #NEWLINE# #INDENT# kwargs [ 'password' ] = encrypt_password ( kwargs [ 'password' ] ) #NEWLINE# _datastore . create_user ( ** kwargs ) #NEWLINE# print ( 'User created successfully.' ) #NEWLINE# kwargs [ 'password' ] = '****' #NEWLINE# pprint ( kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Error creating user' ) #NEWLINE# pprint ( form . errors )