#NEWLINE# def _user_to_credentials( request , user ) : #NEWLINE# #INDENT# if ( not hasattr ( roles , '_credentials' ) ) : #NEWLINE# #INDENT# roles = [ role [ 'name' ] for role in user . roles ] #NEWLINE# user . _credentials = { #NEWLINE# #INDENT# 'user_id' : user . id , #NEWLINE# 'token' : user . token , #NEWLINE# 'username' : user . username , #NEWLINE# 'project_id' : user . project_id , #NEWLINE# 'project_name' : user . project_name , #NEWLINE# 'domain_id' : user . user_domain_id , #NEWLINE# 'is_admin' : user . is_superuser , #NEWLINE# 'roles' : roles , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return user . _credentials