##// END OF EJS Templates
usage of request.GET is now more consistent
marcink -
r3745:7efc8dcc default
parent child Browse files
Show More
@@ -136,7 +136,7 b' class AdminController(BaseController):'
136
136
137 users_log = users_log.order_by(UserLog.action_date.desc())
137 users_log = users_log.order_by(UserLog.action_date.desc())
138
138
139 p = safe_int(request.params.get('page', 1), 1)
139 p = safe_int(request.GET.get('page', 1), 1)
140
140
141 def url_generator(**kw):
141 def url_generator(**kw):
142 return url.current(filter=c.search_term, **kw)
142 return url.current(filter=c.search_term, **kw)
@@ -64,7 +64,7 b' class NotificationsController(BaseContro'
64 notif = NotificationModel().get_for_user(self.rhodecode_user.user_id,
64 notif = NotificationModel().get_for_user(self.rhodecode_user.user_id,
65 filter_=request.GET.getall('type'))
65 filter_=request.GET.getall('type'))
66
66
67 p = safe_int(request.params.get('page', 1), 1)
67 p = safe_int(request.GET.get('page', 1), 1)
68 c.notifications = Page(notif, page=p, items_per_page=10)
68 c.notifications = Page(notif, page=p, items_per_page=10)
69 c.pull_request_type = Notification.TYPE_PULL_REQUEST
69 c.pull_request_type = Notification.TYPE_PULL_REQUEST
70 c.comment_type = [Notification.TYPE_CHANGESET_COMMENT,
70 c.comment_type = [Notification.TYPE_CHANGESET_COMMENT,
@@ -54,20 +54,16 b' class ChangelogController(BaseRepoContro'
54 def index(self):
54 def index(self):
55 limit = 100
55 limit = 100
56 default = 20
56 default = 20
57 if request.params.get('size'):
57 if request.GET.get('size'):
58 try:
58 c.size = max(min(safe_int(request.GET.get('size')), limit), 1)
59 int_size = int(request.params.get('size'))
60 except ValueError:
61 int_size = default
62 c.size = max(min(int_size, limit), 1)
63 session['changelog_size'] = c.size
59 session['changelog_size'] = c.size
64 session.save()
60 session.save()
65 else:
61 else:
66 c.size = int(session.get('changelog_size', default))
62 c.size = int(session.get('changelog_size', default))
67 # min size must be 1
63 # min size must be 1
68 c.size = max(c.size, 1)
64 c.size = max(c.size, 1)
69 p = safe_int(request.params.get('page', 1), 1)
65 p = safe_int(request.GET.get('page', 1), 1)
70 branch_name = request.params.get('branch', None)
66 branch_name = request.GET.get('branch', None)
71 try:
67 try:
72 if branch_name:
68 if branch_name:
73 collection = [z for z in
69 collection = [z for z in
@@ -44,7 +44,7 b' class FollowersController(BaseRepoContro'
44 super(FollowersController, self).__before__()
44 super(FollowersController, self).__before__()
45
45
46 def followers(self, repo_name):
46 def followers(self, repo_name):
47 p = safe_int(request.params.get('page', 1), 1)
47 p = safe_int(request.GET.get('page', 1), 1)
48 repo_id = c.rhodecode_db_repo.repo_id
48 repo_id = c.rhodecode_db_repo.repo_id
49 d = UserFollowing.get_repo_followers(repo_id)\
49 d = UserFollowing.get_repo_followers(repo_id)\
50 .order_by(UserFollowing.follows_from)
50 .order_by(UserFollowing.follows_from)
@@ -110,7 +110,7 b' class ForksController(BaseRepoController'
110 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
110 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
111 'repository.admin')
111 'repository.admin')
112 def forks(self, repo_name):
112 def forks(self, repo_name):
113 p = safe_int(request.params.get('page', 1), 1)
113 p = safe_int(request.GET.get('page', 1), 1)
114 repo_id = c.rhodecode_db_repo.repo_id
114 repo_id = c.rhodecode_db_repo.repo_id
115 d = []
115 d = []
116 for r in Repository.get_repo_forks(repo_id):
116 for r in Repository.get_repo_forks(repo_id):
@@ -62,7 +62,7 b' class JournalController(BaseController):'
62 @NotAnonymous()
62 @NotAnonymous()
63 def index(self):
63 def index(self):
64 # Return a rendered template
64 # Return a rendered template
65 p = safe_int(request.params.get('page', 1), 1)
65 p = safe_int(request.GET.get('page', 1), 1)
66 c.user = User.get(self.rhodecode_user.user_id)
66 c.user = User.get(self.rhodecode_user.user_id)
67 c.following = self.sa.query(UserFollowing)\
67 c.following = self.sa.query(UserFollowing)\
68 .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\
68 .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\
@@ -250,7 +250,7 b' class JournalController(BaseController):'
250 @LoginRequired()
250 @LoginRequired()
251 def public_journal(self):
251 def public_journal(self):
252 # Return a rendered template
252 # Return a rendered template
253 p = safe_int(request.params.get('page', 1), 1)
253 p = safe_int(request.GET.get('page', 1), 1)
254
254
255 c.following = self.sa.query(UserFollowing)\
255 c.following = self.sa.query(UserFollowing)\
256 .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\
256 .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\
@@ -142,7 +142,7 b' class PullrequestsController(BaseRepoCon'
142 def show_all(self, repo_name):
142 def show_all(self, repo_name):
143 c.pull_requests = PullRequestModel().get_all(repo_name)
143 c.pull_requests = PullRequestModel().get_all(repo_name)
144 c.repo_name = repo_name
144 c.repo_name = repo_name
145 p = safe_int(request.params.get('page', 1), 1)
145 p = safe_int(request.GET.get('page', 1), 1)
146
146
147 c.pullrequests_pager = Page(c.pull_requests, page=p, items_per_page=10)
147 c.pullrequests_pager = Page(c.pull_requests, page=p, items_per_page=10)
148
148
@@ -84,7 +84,7 b' class SearchController(BaseRepoControlle'
84 log.debug(cur_query)
84 log.debug(cur_query)
85
85
86 if c.cur_query:
86 if c.cur_query:
87 p = safe_int(request.params.get('page', 1), 1)
87 p = safe_int(request.GET.get('page', 1), 1)
88 highlight_items = set()
88 highlight_items = set()
89 try:
89 try:
90 idx = open_dir(config['app_conf']['index_dir'],
90 idx = open_dir(config['app_conf']['index_dir'],
@@ -64,8 +64,8 b' class ShortlogController(BaseRepoControl'
64 redirect(h.url('shortlog_home', repo_name=repo_name))
64 redirect(h.url('shortlog_home', repo_name=repo_name))
65
65
66 def index(self, repo_name, revision=None, f_path=None):
66 def index(self, repo_name, revision=None, f_path=None):
67 p = safe_int(request.params.get('page', 1), 1)
67 p = safe_int(request.GET.get('page', 1), 1)
68 size = safe_int(request.params.get('size', 20), 20)
68 size = safe_int(request.GET.get('size', 20), 20)
69 collection = c.rhodecode_repo
69 collection = c.rhodecode_repo
70 c.file_history = f_path
70 c.file_history = f_path
71
71
General Comments 0
You need to be logged in to leave comments. Login now