Fixed bug where an extra blank page would show on "latest" if number of quotes was divisible by 10
This commit is contained in:
parent
38a97f4bde
commit
9e57a47bb5
1 changed files with 10 additions and 10 deletions
|
@ -79,7 +79,7 @@ def latest():
|
||||||
"latest.html",
|
"latest.html",
|
||||||
title="Latest",
|
title="Latest",
|
||||||
quotes=quotes,
|
quotes=quotes,
|
||||||
numpages=1 + allquotes//10,
|
numpages=1 + allquotes//10 if allquotes%10 != 0 else allquotes//10,
|
||||||
curpage=0,
|
curpage=0,
|
||||||
page_type="latest"
|
page_type="latest"
|
||||||
)
|
)
|
||||||
|
@ -95,15 +95,15 @@ def latest_page(page):
|
||||||
for quote in quotes:
|
for quote in quotes:
|
||||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"latest.html",
|
"latest.html",
|
||||||
title="Latest - page {}".format(page),
|
title="Latest - page {}".format(page),
|
||||||
quotes=quotes,
|
quotes=quotes,
|
||||||
numpages=1 + allquotes//10,
|
numpages=1 + allquotes//10 if allquotes%10 != 0 else allquotes//10,
|
||||||
curpage=page-1,
|
curpage=page-1,
|
||||||
page_type="latest"
|
page_type="latest"
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.route('/queue')
|
@app.route('/queue')
|
||||||
def queue():
|
def queue():
|
||||||
if not session.get('authorized'):
|
if not session.get('authorized'):
|
||||||
|
|
Loading…
Add table
Reference in a new issue