simple: do not search if there's no criteria
This commit is contained in:
parent
bdbdebe236
commit
70469e91f5
|
@ -25,6 +25,8 @@ class SearchForm(form.Form):
|
|||
def deputy_results(self):
|
||||
catalog = getToolByName(self.context, 'portal_catalog')
|
||||
data, errors = self.extractData()
|
||||
if data.get('SearchableText') is None:
|
||||
return []
|
||||
return catalog(
|
||||
portal_type=['themis.datatypes.deputy'],
|
||||
SearchableText=data.get('SearchableText'))
|
||||
|
@ -32,6 +34,8 @@ class SearchForm(form.Form):
|
|||
def page_results(self):
|
||||
catalog = getToolByName(self.context, 'portal_catalog')
|
||||
data, errors = self.extractData()
|
||||
if data.get('SearchableText') is None:
|
||||
return []
|
||||
return catalog(
|
||||
portal_type=['Document', 'File', 'Folder', 'Link'],
|
||||
SearchableText=data.get('SearchableText'))
|
||||
|
@ -39,6 +43,8 @@ class SearchForm(form.Form):
|
|||
def doc_results(self):
|
||||
catalog = getToolByName(self.context, 'portal_catalog')
|
||||
data, errors = self.extractData()
|
||||
if data.get('SearchableText') is None:
|
||||
return []
|
||||
return catalog(
|
||||
portal_type=['tabellio.documents.dossier', 'tabellio.documents.document'],
|
||||
SearchableText=data.get('SearchableText'))
|
||||
|
@ -46,6 +52,8 @@ class SearchForm(form.Form):
|
|||
def event_results(self):
|
||||
catalog = getToolByName(self.context, 'portal_catalog')
|
||||
data, errors = self.extractData()
|
||||
if data.get('SearchableText') is None:
|
||||
return []
|
||||
return catalog(
|
||||
portal_type=['tabellio.agenda.parlevent', 'tabellio.agenda.event'],
|
||||
SearchableText=data.get('SearchableText'))
|
||||
|
|
Reference in New Issue