1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 06:34:40 +00:00

fix bug in pagination

This commit is contained in:
llj
2012-04-09 16:48:14 +08:00
parent ed41db3206
commit f21f367b61

View File

@@ -105,7 +105,7 @@ def repo(request, repo_id):
current_page = int(request.GET.get('page', '1')) current_page = int(request.GET.get('page', '1'))
per_page= int(request.GET.get('per_page', '25')) per_page= int(request.GET.get('per_page', '25'))
except ValueError: except ValueError:
page = 1 current_page = 1
per_page = 25 per_page = 25
commits_all = get_commits(repo_id, per_page * (current_page -1), per_page + 1) commits_all = get_commits(repo_id, per_page * (current_page -1), per_page + 1)
@@ -237,7 +237,7 @@ def seafadmin(request):
current_page = int(request.GET.get('page', '1')) current_page = int(request.GET.get('page', '1'))
per_page= int(request.GET.get('per_page', '25')) per_page= int(request.GET.get('per_page', '25'))
except ValueError: except ValueError:
page = 1 current_page = 1
per_page = 25 per_page = 25
repos_all = seafserv_threaded_rpc.get_repo_list(per_page * (current_page -1), per_page + 1) repos_all = seafserv_threaded_rpc.get_repo_list(per_page * (current_page -1), per_page + 1)