#NEWLINE# def user_to_dict( self , user ) : #NEWLINE# #INDENT# "Returns a dictionary based on a user object.\n\n        Extra attributes to be retrieved must be set in this module's\n        configuration.\n\n        :param user:\n            User object: an instance the custom user model.\n        :returns:\n            A dictionary with user data.\n        " #NEWLINE# if ( not user ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# user_dict = dict ( ( ( a , getattr ( user , a ) ) for a in self . user_attributes ) ) #NEWLINE# user_dict [ 'user_id' ] = user . get_id ( ) #NEWLINE# return a