X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/eb1b2a97a14f9a4daa772709972e0d1650ac4fd3..f32668123bbf48a0b73e90024bc09aa60e903ea0:/forum/views/users.py diff --git a/forum/views/users.py b/forum/views/users.py index 9dbde3e..0eeb122 100644 --- a/forum/views/users.py +++ b/forum/views/users.py @@ -35,13 +35,13 @@ class UserReputationSort(pagination.SimpleSort): return objects.order_by('-is_active', self.order_by) class UserListPaginatorContext(pagination.PaginatorContext): - def __init__(self): + def __init__(self, pagesizes=(20, 35, 60)): super (UserListPaginatorContext, self).__init__('USERS_LIST', sort_methods=( (_('reputation'), UserReputationSort(_('reputation'), '-reputation', _("sorted by reputation"))), (_('newest'), pagination.SimpleSort(_('recent'), '-date_joined', _("newest members"))), (_('last'), pagination.SimpleSort(_('oldest'), 'date_joined', _("oldest members"))), (_('name'), pagination.SimpleSort(_('by username'), 'username', _("sorted by username"))), - ), pagesizes=(20, 35, 60)) + ), pagesizes=pagesizes) class SubscriptionListPaginatorContext(pagination.PaginatorContext): def __init__(self): @@ -306,7 +306,7 @@ def user_profile(request, user): up_votes = user.vote_up_count down_votes = user.vote_down_count votes_today = user.get_vote_count_today() - votes_total = users.can_vote_count_today() + votes_total = user.can_vote_count_today() user_tags = Tag.objects.filter(Q(nodes__author=user) | Q(nodes__children__author=user)) \ .annotate(user_tag_usage_count=Count('name')).order_by('-user_tag_usage_count') @@ -315,7 +315,7 @@ def user_profile(request, user): Badge.objects.filter(awards__user=user).values('id').annotate(count=Count('cls')).order_by('-count')] return pagination.paginated(request, ( - ('questions', QuestionListPaginatorContext('USER_QUESTION_LIST', _('questions'), 15)), + ('questions', QuestionListPaginatorContext('USER_QUESTION_LIST', _('questions'), default_pagesize=15)), ('answers', UserAnswersPaginatorContext())), { "view_user" : user, "questions" : questions,