#NEWLINE# @ base . require_user #NEWLINE# def get( self , exploration_id ) : #NEWLINE# #INDENT# threads = None #NEWLINE# list_type = self . request . get ( 'list_type' ) #NEWLINE# has_suggestion = self . _string_to_bool ( self . request . get ( 'has_suggestion' ) ) #NEWLINE# if ( list_type is None ) : #NEWLINE# #INDENT# raise self . InvalidInputException ( 'Invalid value for has_suggestion.' ) #NEWLINE# #UNINDENT# if ( list_type == self . _LIST_TYPE_OPEN ) : #NEWLINE# #INDENT# threads = feedback_services . get_open_threads ( exploration_id , has_suggestion ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( list_type == self . _LIST_TYPE_CLOSED ) : #NEWLINE# #INDENT# threads = feedback_services . get_closed_threads ( exploration_id , has_suggestion ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( list_type == self . _LIST_TYPE_ALL ) : #NEWLINE# #INDENT# threads = feedback_services . get_all_threads ( exploration_id , has_suggestion ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise self . InvalidInputException ( 'Invalid list type.' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . values . update ( { #NEWLINE# #INDENT# 'threads' : [ t . to_dict ( ) for t in threads ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . render_json ( self . values )