]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/users.py
make user subscriptions view decoratable
[osqa.git] / forum / views / users.py
index df38159d9482907e0bad9c80e2a7d8889ba2fe7f..84f1cdf2ad222e182161a658a620d8f01953cc46 100644 (file)
@@ -33,13 +33,13 @@ class UserReputationSort(pagination.SimpleSort):
         return objects.order_by('-is_active', self.order_by)\r
 \r
 class UserListPaginatorContext(pagination.PaginatorContext):\r
-    def __init__(self, pagesizes=(20, 35, 60)):\r
+    def __init__(self, pagesizes=(20, 35, 60), default_pagesize=35):\r
         super (UserListPaginatorContext, self).__init__('USERS_LIST', sort_methods=(\r
             (_('reputation'), UserReputationSort(_('reputation'), '-reputation', _("sorted by reputation"))),\r
             (_('newest'), pagination.SimpleSort(_('recent'), '-date_joined', _("newest members"))),\r
             (_('last'), pagination.SimpleSort(_('oldest'), 'date_joined', _("oldest members"))),\r
             (_('name'), pagination.SimpleSort(_('by username'), 'username', _("sorted by username"))),\r
-        ), pagesizes=pagesizes)\r
+        ), pagesizes=pagesizes, default_pagesize=default_pagesize)\r
 \r
 class SubscriptionListPaginatorContext(pagination.PaginatorContext):\r
     def __init__(self):\r
@@ -394,6 +394,9 @@ def user_favorites(request, user, **kwargs):
 \r
 @user_view('users/subscriptions.html', 'subscriptions', _('subscription'), _('subscriptions'), True, tabbed=False)\r
 def user_subscriptions(request, user, **kwargs):\r
+    return _user_subscriptions(request, user, **kwargs)\r
+\r
+def _user_subscriptions(request, user, **kwargs):\r
     enabled = True\r
 \r
     tab = request.GET.get('tab', "settings")\r