Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
08fbac1d
Commit
08fbac1d
authored
Dec 16, 2015
by
Jamesie Pic
Browse files
Bugfix: was passing a string num_by_page
parent
93c04aea
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/utils.py
View file @
08fbac1d
...
...
@@ -26,7 +26,8 @@ def render_paginate_list(request, object_list, template_name):
Render a paginated list of representatives
"""
pagination_limits
=
(
10
,
20
,
50
,
100
)
num_by_page
=
request
.
GET
.
get
(
'limit'
,
30
)
num_by_page
=
request
.
GET
.
get
(
'limit'
,
'30'
)
num_by_page
=
int
(
num_by_page
)
if
num_by_page
.
isdigit
()
else
1
paginator
=
Paginator
(
object_list
,
num_by_page
)
number
=
request
.
GET
.
get
(
'page'
,
'1'
)
number
=
int
(
number
)
if
number
.
isdigit
()
else
1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment