allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [04/10] allura git commit: [#7794] ticket:677 Always use user prefs for page size
Date Wed, 19 Nov 2014 22:59:43 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/7b1769f3
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/7b1769f3
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/7b1769f3

Branch: refs/heads/master
Commit: 7b1769f3b1d414cd4653c84d7abf14a008ffa8e9
Parents: bcd41c9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Nov 14 07:45:49 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Nov 19 22:58:32 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/7b1769f3/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