##// END OF EJS Templates
commits/summary: unify fetching remote attribute in summary and commits page to properly and in the same way show the data.
super-admin -
r4750:8532c1ca default
parent child Browse files
Show More
@@ -389,6 +389,11 b' class RepoAppView(BaseAppView):'
389 return True
389 return True
390 return False
390 return False
391
391
392 def get_commit_preload_attrs(cls):
393 pre_load = ['author', 'branch', 'date', 'message', 'parents',
394 'obsolete', 'phase', 'hidden']
395 return pre_load
396
392
397
393 class PathFilter(object):
398 class PathFilter(object):
394
399
@@ -168,11 +168,6 b' class RepoChangelogView(RepoAppView):'
168
168
169 return c
169 return c
170
170
171 def _get_preload_attrs(self):
172 pre_load = ['author', 'branch', 'date', 'message', 'parents',
173 'obsolete', 'phase', 'hidden']
174 return pre_load
175
176 @LoginRequired()
171 @LoginRequired()
177 @HasRepoPermissionAnyDecorator(
172 @HasRepoPermissionAnyDecorator(
178 'repository.read', 'repository.write', 'repository.admin')
173 'repository.read', 'repository.write', 'repository.admin')
@@ -200,7 +195,7 b' class RepoChangelogView(RepoAppView):'
200 self._check_if_valid_branch(branch_name, self.db_repo_name, f_path)
195 self._check_if_valid_branch(branch_name, self.db_repo_name, f_path)
201
196
202 c.changelog_for_path = f_path
197 c.changelog_for_path = f_path
203 pre_load = self._get_preload_attrs()
198 pre_load = self.get_commit_preload_attrs()
204
199
205 partial_xhr = self.request.environ.get('HTTP_X_PARTIAL_XHR')
200 partial_xhr = self.request.environ.get('HTTP_X_PARTIAL_XHR')
206
201
@@ -256,6 +251,8 b' class RepoChangelogView(RepoAppView):'
256 raise HTTPFound(
251 raise HTTPFound(
257 h.route_path('repo_summary', repo_name=self.db_repo_name))
252 h.route_path('repo_summary', repo_name=self.db_repo_name))
258
253
254
255
259 if partial_xhr or self.request.environ.get('HTTP_X_PJAX'):
256 if partial_xhr or self.request.environ.get('HTTP_X_PJAX'):
260 # case when loading dynamic file history in file view
257 # case when loading dynamic file history in file view
261 # loading from ajax, we don't want the first result, it's popped
258 # loading from ajax, we don't want the first result, it's popped
@@ -304,7 +301,7 b' class RepoChangelogView(RepoAppView):'
304 return wrap_for_error(
301 return wrap_for_error(
305 safe_str('Branch: {} is not valid'.format(branch_name)))
302 safe_str('Branch: {} is not valid'.format(branch_name)))
306
303
307 pre_load = self._get_preload_attrs()
304 pre_load = self.get_commit_preload_attrs()
308
305
309 if f_path:
306 if f_path:
310 try:
307 try:
@@ -65,7 +65,8 b' class RepoSummaryView(RepoAppView):'
65 'repo_summary_commits',
65 'repo_summary_commits',
66 repo_name=c.rhodecode_db_repo.repo_name, _query=query_params)
66 repo_name=c.rhodecode_db_repo.repo_name, _query=query_params)
67
67
68 pre_load = ['author', 'branch', 'date', 'message']
68 pre_load = self.get_commit_preload_attrs()
69
69 try:
70 try:
70 collection = self.rhodecode_vcs_repo.get_commits(
71 collection = self.rhodecode_vcs_repo.get_commits(
71 pre_load=pre_load, translate_tags=False)
72 pre_load=pre_load, translate_tags=False)
General Comments 0
You need to be logged in to leave comments. Login now