Mercurial > kallithea
diff rhodecode/controllers/changelog.py @ 3794:222e9432298e beta
in case of empty directory don't redirect to changelog, it causes an redirection loop
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 27 Apr 2013 00:40:16 +0200 |
parents | c7970889c5c0 |
children | a42bfe8a9335 |
line wrap: on
line diff
--- a/rhodecode/controllers/changelog.py Fri Apr 26 14:14:46 2013 +0200 +++ b/rhodecode/controllers/changelog.py Sat Apr 27 00:40:16 2013 +0200 @@ -37,7 +37,7 @@ from rhodecode.lib.compat import json from rhodecode.lib.graphmod import _colored, _dagwalker from rhodecode.lib.vcs.exceptions import RepositoryError, ChangesetDoesNotExistError,\ - ChangesetError, NodeDoesNotExistError + ChangesetError, NodeDoesNotExistError, EmptyRepositoryError from rhodecode.lib.utils2 import safe_int from webob.exc import HTTPNotFound @@ -137,6 +137,9 @@ page_revisions = [x.raw_id for x in c.pagination] c.comments = c.rhodecode_db_repo.get_comments(page_revisions) c.statuses = c.rhodecode_db_repo.statuses(page_revisions) + except (EmptyRepositoryError), e: + h.flash(str(e), category='warning') + return redirect(url('summary_home', repo_name=c.repo_name)) except (RepositoryError, ChangesetDoesNotExistError, Exception), e: log.error(traceback.format_exc()) h.flash(str(e), category='error')