#NEWLINE# def group_es_query( self , query , group_type = 'reporting' ) : #NEWLINE# #INDENT# if ( group_type == 'reporting' ) : #NEWLINE# #INDENT# type_filter = groups . is_reporting ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( group_type == 'case_sharing' ) : #NEWLINE# #INDENT# type_filter = groups . is_case_sharing ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( "group_type '{}' not recognized" . format ( group_type ) ) #NEWLINE# #UNINDENT# #UNINDENT# return GroupES ( ) . domain ( self . domain ) . filter ( type_filter ) . not_deleted ( ) . search_string_query ( query , default_fields = [ 'name' ] )