changeset 3804:b95f383f428d

backported redirection loop fix from beta ref: 222e9432298e
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 02 May 2013 13:50:19 +0200
parents 9c91d3e4a11c
children 68331e680ac5
files rhodecode/controllers/changelog.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/changelog.py	Sat Apr 27 01:47:56 2013 +0200
+++ b/rhodecode/controllers/changelog.py	Thu May 02 13:50:19 2013 +0200
@@ -36,7 +36,8 @@
 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 @@
             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')