allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [18/26] allura git commit: [#7794] ticket:677 Always use user prefs for page size
Date Wed, 19 Nov 2014 14:01:29 GMT
[#7794] ticket:677 Always use user prefs for page size


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/015416ba
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/015416ba
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/015416ba

Branch: refs/heads/ib/7794
Commit: 015416ba6b9335f1d3232520d20499a1dac3e44d
Parents: e2bd828
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Nov 14 07:45:49 2014 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Nov 18 11:46:22 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/015416ba/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 2d5136e..ac8bcdb 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -387,19 +387,9 @@ class Globals(object):
         return (limit, page, start)
 
     def manage_paging_preference(self, limit, default=50):
-        if limit:
+        if not limit:
             if c.user in (None, M.User.anonymous()):
-                session['results_per_page'] = int(limit)
-                session.save()
-            else:
-                c.user.set_pref('results_per_page', int(limit))
-        else:
-            if c.user in (None, M.User.anonymous()):
-                try:
-                    limit = session['results_per_page']
-                # TypeError if no session registered for thread
-                except (KeyError, TypeError):
-                    limit = default
+                limit = default
             else:
                 limit = c.user.get_pref('results_per_page') or default
         return limit


Mime
View raw message