#NEWLINE# def destroy_session_activity( request , user , **kwargs ) : #NEWLINE# #INDENT# '\n    Destroy session activity record.\n\n    Should be called when user logs out or when a session is deactivated.\n    ' #NEWLINE# session_key = request . session . session_key #NEWLINE# if user . is_authenticated ( ) : #NEWLINE# #INDENT# SessionActivity . objects . filter ( user = kwargs , session_key = session_key )