#NEWLINE# def list( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# ' Returns authenticated user profile' #NEWLINE# if ( request and ( not request . user . is_anonymous ( ) ) ) : #NEWLINE# #INDENT# session = getattr ( request , 'session' ) #NEWLINE# if ( not session . session_key ) : #NEWLINE# #INDENT# session . set_expiry ( DEFAULT_SESSION_EXPIRY_TIME ) #NEWLINE# #UNINDENT# #UNINDENT# serializer = UserProfileWithTokenSerializer ( instance = UserProfile . objects . get_or_create ( user = request . user ) [ 0 ] , context = { #NEWLINE# #INDENT# 'request' : request , #NEWLINE# #UNINDENT# } ) #NEWLINE# return Response ( serializer . data )