aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-05-02 13:50:19 +0200
committerMarcin Kuzminski <marcin@python-works.com>2013-05-02 13:50:19 +0200
commit4add33cdb6ecbdf3f8af4ceea0bba9bceec21cae (patch)
treeaf63385b6b2453c97ffa155e98c6df9fb0b42b4d
parentb2e8c0fd97005a5e3e2be319a639ab87dab11863 (diff)
downloadrhodecode-4add33cdb6ecbdf3f8af4ceea0bba9bceec21cae.tar.gz
backported redirection loop fix from beta ref: 222e9432298e
-rw-r--r--rhodecode/controllers/changelog.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py
index af9ff471..5837528f 100644
--- a/rhodecode/controllers/changelog.py
+++ b/rhodecode/controllers/changelog.py
@@ -36,7 +36,8 @@ from rhodecode.lib.base import BaseRepoController, render
from rhodecode.lib.helpers import RepoPage
from rhodecode.lib.compat import json
from rhodecode.lib.graphmod import _colored, _dagwalker
-from rhodecode.lib.vcs.exceptions import RepositoryError, ChangesetDoesNotExistError
+from rhodecode.lib.vcs.exceptions import RepositoryError, ChangesetDoesNotExistError,\
+ EmptyRepositoryError
from rhodecode.lib.utils2 import safe_int
log = logging.getLogger(__name__)
@@ -80,6 +81,9 @@ class ChangelogController(BaseRepoController):
page_revisions = [x.raw_id for x in collection]
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')