summaryrefslogtreecommitdiff
path: root/workshop_app/views.py
diff options
context:
space:
mode:
authorpnshiralkar2020-05-04 16:42:13 +0530
committerpnshiralkar2020-05-04 16:42:13 +0530
commit5f37f03f143b976d6e1c9b65def1e69feb27ec22 (patch)
tree530414f3b0ad9b11264b9adfd95845fc97f71cb1 /workshop_app/views.py
parent752b9eb3bcccb8383a51fcfe8d550e7b5af6a77e (diff)
downloadworkshop_booking-5f37f03f143b976d6e1c9b65def1e69feb27ec22.tar.gz
workshop_booking-5f37f03f143b976d6e1c9b65def1e69feb27ec22.tar.bz2
workshop_booking-5f37f03f143b976d6e1c9b65def1e69feb27ec22.zip
Pagination removed try catch
Diffstat (limited to 'workshop_app/views.py')
-rw-r--r--workshop_app/views.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/workshop_app/views.py b/workshop_app/views.py
index 7fdb7f6..5d0525c 100644
--- a/workshop_app/views.py
+++ b/workshop_app/views.py
@@ -362,14 +362,7 @@ def workshop_type_list(request):
paginator = Paginator(workshop_types, 12) # Show upto 12 workshops per page
page = request.GET.get('page')
- try:
- workshop_type = paginator.page(page)
- except PageNotAnInteger:
- # If page is not an integer, deliver first page.
- workshop_type = paginator.page(1)
- except EmptyPage:
- # If page is out of range(e.g 999999), deliver last page.
- workshop_type = paginator.get_page(paginator.num_pages)
+ workshop_type = paginator.get_page(paginator.num_pages)
return render(request, 'workshop_app/workshop_type_list.html', {'workshop_type': workshop_type})