allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [4/6] allura git commit: [#7794] ticket:677 Always use user prefs for page size
Date Fri, 14 Nov 2014 11:55:52 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/9e3eb5f9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9e3eb5f9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9e3eb5f9

Branch: refs/heads/ib/7794
Commit: 9e3eb5f9af6e14e9bd3ddd793a124ef55c668523
Parents: 414955b
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Nov 14 07:45:49 2014 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Fri Nov 14 08:57:43 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/9e3eb5f9/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