Actually paginate the teams page, instead of only ever showing the first page of teams (#142)

This commit is contained in:
Josh Hofing
2016-08-23 00:36:41 -04:00
committed by Kevin Chung
parent 831a959d39
commit 9860c8dc78

View File

@@ -124,10 +124,11 @@ def teams(page):
page_end = results_per_page * ( page - 1 ) + results_per_page
if get_config('verify_emails'):
count = Teams.query.filter_by(verified=True).count()
teams = Teams.query.filter_by(verified=True).slice(page_start, page_end).all()
else:
count = Teams.query.count()
teams = Teams.query.slice(page_start, page_end).all()
count = len(teams)
pages = int(count / results_per_page) + (count % results_per_page > 0)
return render_template('teams.html', teams=teams, team_pages=pages, curr_page=page)