Paginator returns page.object_list as objects if a page exists.
[philo.git] / utils.py
index 11f9848..efd9f98 100644 (file)
--- a/utils.py
+++ b/utils.py
@@ -99,5 +99,7 @@ def paginate(objects, per_page=None, page_number=1):
                page = paginator.page(page_number)
        except EmptyPage:
                page = None
                page = paginator.page(page_number)
        except EmptyPage:
                page = None
+       else:
+               objects = page.object_list
        
        return paginator, page, objects
        
        return paginator, page, objects