Skip to content

Commit

Permalink
Returning nothing is better... #12
Browse files Browse the repository at this point in the history
  • Loading branch information
moschlar committed Jun 20, 2013
1 parent 0329d29 commit 1b77e80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tgext/crud/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,11 @@ def get_all(self, *args, **kw):
try:
values = self.table_filler.get_value(substring_filters=substring_filters, **kw)
except Exception as e:
flash(u'Search query was invalid: %s' % e, 'warn')
flash(u'Invalid search query "%s": %s' % (request.query_string, e), 'warn')
# Reset all variables to sane defaults
kw = {}
values = self.table_filler.get_value(substring_filters=substring_filters, **kw)
values = []
self.table_filler.__count__ = 0
if self.pagination_enabled:
values = SmartPaginationCollection(values, self.table_filler.__count__)
else:
Expand Down

0 comments on commit 1b77e80

Please sign in to comment.