From 148cbd2f57a12d2b572d4a5a8ddca0ddedc5a030 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 11 Jul 2017 10:57:35 -0500 Subject: [PATCH] Fix bug with "memory" of mobile grid filters --- tailbone/newgrids/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tailbone/newgrids/core.py b/tailbone/newgrids/core.py index 36cf5b8b..b06c737b 100644 --- a/tailbone/newgrids/core.py +++ b/tailbone/newgrids/core.py @@ -311,8 +311,12 @@ class Grid(object): """ Determine if the current session contains any settings for the grid. """ - # Session should have all or nothing, so just check one key. - return 'grid.{0}.sortkey'.format(self.key) in self.request.session + # session should have all or nothing, so just check a few keys which + # should be guaranteed present if anything has been stashed + for key in ['page', 'sortkey']: + if 'grid.{}.{}'.format(self.key, key) in self.request.session: + return True + return False def get_setting(self, source, settings, key, coerce=lambda v: v, default=None): """