Instead of returning the empty string, make advanced template search return a search with no comparison value so the user will see the error messages.

This commit is contained in:
Charles Haley 2023-05-31 19:14:18 +01:00
parent c5d4ece489
commit 7ec6bc2167

View File

@ -442,13 +442,11 @@ class SearchDialog(QDialog):
def template_search_string(self): def template_search_string(self):
template = str(self.template_program_box.text()) template = str(self.template_program_box.text())
value = str(self.template_value_box.text()) value = str(self.template_value_box.text())
if template and value: cb = self.template_test_type_box
cb = self.template_test_type_box op = str(cb.itemData(cb.currentIndex()))
op = str(cb.itemData(cb.currentIndex())) l = f'{template}#@#:{op}:{value}'
l = f'{template}#@#:{op}:{value}' # Use docstring quoting (super-quoting) to avoid problems with escaping
# Use docstring quoting (super-quoting) to avoid problems with escaping return 'template:"""' + l + '"""'
return 'template:"""' + l + '"""'
return ''
def date_search_string(self): def date_search_string(self):
field = str(self.date_field.itemData(self.date_field.currentIndex()) or '') field = str(self.date_field.itemData(self.date_field.currentIndex()) or '')