##// END OF EJS Templates
commits/changelog: small fixes from found problems
milka -
r4591:749b9ba7 stable
parent child Browse files
Show More
@@ -216,6 +216,7 b' class RepoChangelogView(RepoAppView):'
216 pre_load = self._get_preload_attrs()
216 pre_load = self._get_preload_attrs()
217
217
218 partial_xhr = self.request.environ.get('HTTP_X_PARTIAL_XHR')
218 partial_xhr = self.request.environ.get('HTTP_X_PARTIAL_XHR')
219
219 try:
220 try:
220 if f_path:
221 if f_path:
221 log.debug('generating changelog for path %s', f_path)
222 log.debug('generating changelog for path %s', f_path)
@@ -258,8 +259,15 b' class RepoChangelogView(RepoAppView):'
258 except (RepositoryError, CommitDoesNotExistError, Exception) as e:
259 except (RepositoryError, CommitDoesNotExistError, Exception) as e:
259 log.exception(safe_str(e))
260 log.exception(safe_str(e))
260 h.flash(safe_str(h.escape(e)), category='error')
261 h.flash(safe_str(h.escape(e)), category='error')
261 raise HTTPFound(
262
262 h.route_path('repo_commits', repo_name=self.db_repo_name))
263 if commit_id:
264 # from single commit page, we redirect to main commits
265 raise HTTPFound(
266 h.route_path('repo_commits', repo_name=self.db_repo_name))
267 else:
268 # otherwise we redirect to summary
269 raise HTTPFound(
270 h.route_path('repo_summary', repo_name=self.db_repo_name))
263
271
264 if partial_xhr or self.request.environ.get('HTTP_X_PJAX'):
272 if partial_xhr or self.request.environ.get('HTTP_X_PJAX'):
265 # case when loading dynamic file history in file view
273 # case when loading dynamic file history in file view
@@ -41,7 +41,7 b' from rhodecode.lib.diffs import ('
41 get_diff_whitespace_flag)
41 get_diff_whitespace_flag)
42 from rhodecode.lib.exceptions import StatusChangeOnClosedPullRequestError, CommentVersionMismatch
42 from rhodecode.lib.exceptions import StatusChangeOnClosedPullRequestError, CommentVersionMismatch
43 import rhodecode.lib.helpers as h
43 import rhodecode.lib.helpers as h
44 from rhodecode.lib.utils2 import safe_unicode, str2bool, StrictAttributeDict
44 from rhodecode.lib.utils2 import safe_unicode, str2bool, StrictAttributeDict, safe_str
45 from rhodecode.lib.vcs.backends.base import EmptyCommit
45 from rhodecode.lib.vcs.backends.base import EmptyCommit
46 from rhodecode.lib.vcs.exceptions import (
46 from rhodecode.lib.vcs.exceptions import (
47 RepositoryError, CommitDoesNotExistError)
47 RepositoryError, CommitDoesNotExistError)
@@ -110,7 +110,7 b' class RepoCommitsView(RepoAppView):'
110 if not c.commit_ranges:
110 if not c.commit_ranges:
111 raise RepositoryError('The commit range returned an empty result')
111 raise RepositoryError('The commit range returned an empty result')
112 except CommitDoesNotExistError as e:
112 except CommitDoesNotExistError as e:
113 msg = _('No such commit exists. Org exception: `{}`').format(e)
113 msg = _('No such commit exists. Org exception: `{}`').format(safe_str(e))
114 h.flash(msg, category='error')
114 h.flash(msg, category='error')
115 raise HTTPNotFound()
115 raise HTTPNotFound()
116 except Exception:
116 except Exception:
General Comments 0
You need to be logged in to leave comments. Login now