diff gpp/bio/views.py @ 243:7ddd60164245

For #93: remove the page number from the URL. This commit fixes the shoutbox and member list. It also contains a change to downloads to add pagination to the new, popular, and highest rated views.
author Brian Neal <bgneal@gmail.com>
date Thu, 16 Sep 2010 01:06:43 +0000
parents b4305e18d3af
children 75ea1a8be7f2
line wrap: on
line diff
--- a/gpp/bio/views.py	Wed Sep 15 03:24:01 2010 +0000
+++ b/gpp/bio/views.py	Thu Sep 16 01:06:43 2010 +0000
@@ -10,6 +10,7 @@
 from django.http import HttpResponse
 from django.http import HttpResponseBadRequest
 from django.http import HttpResponseRedirect
+from django.http import Http404
 from django.core.paginator import InvalidPage
 from django.core.urlresolvers import reverse
 from django.contrib.auth.decorators import login_required
@@ -28,11 +29,12 @@
 from bio.forms import SearchUsersForm
 from core.paginator import DiggPaginator
 from core.functions import email_admins
+from core.functions import get_page
 
 #######################################################################
 
 @login_required
-def member_list(request, type='user', page=1):
+def member_list(request, type='user'):
     """
     This view displays the member list. Only active members are displayed.
     """
@@ -44,8 +46,9 @@
     num_members = qs.count()
 
     paginator = DiggPaginator(qs, 20, body=5, tail=3, margin=3, padding=2)
+    page = get_page(request.GET)
     try:
-        the_page = paginator.page(int(page))
+        the_page = paginator.page(page)
     except InvalidPage:
         raise Http404