From 6eb7aca2f53554e9abe12c8badf7f443e2b48d86 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Tue, 9 Aug 2016 15:48:05 -0300 Subject: [PATCH] Fix to smart_pagination Signed-off-by: Luciano Almeida --- sigi/apps/home/templatetags/smart_pagination.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigi/apps/home/templatetags/smart_pagination.py b/sigi/apps/home/templatetags/smart_pagination.py index 4dcbca2..4475cdc 100644 --- a/sigi/apps/home/templatetags/smart_pagination.py +++ b/sigi/apps/home/templatetags/smart_pagination.py @@ -29,9 +29,9 @@ def smart_paginator(page_obj, querystring=None): else: querystring = '?' - page_range = page_obj.paginator.page_range + page_range = list(page_obj.paginator.page_range) mid = len(page_range) / 2 - + range = list(set(page_range[:3]) | set(page_range[mid-2:mid+1]) | set(page_range[-3:]) | set(page_range[page_obj.number-2:page_obj.number+1])) range.sort()