# HG changeset patch # User Marcin Kuzminski # Date 2010-07-16 12:10:29 # Node ID 76f8bef61098228cc92ccc24283777de95837a26 # Parent d09381593b123634e1ed96581224d49cf57e987b fixed path error for error controller diff --git a/pylons_app/controllers/error.py b/pylons_app/controllers/error.py --- a/pylons_app/controllers/error.py +++ b/pylons_app/controllers/error.py @@ -38,10 +38,14 @@ class ErrorController(BaseController): if resp.status_int == 404: org_e = request.environ.get('pylons.original_request').environ - c.repo_name = repo_name = org_e['PATH_INFO'].split('/')[1] + try: + c.repo_name = org_e['PATH_INFO'].split('/')[1] + except IndexError: + c.repo_name = '' + c.hg_app_version = __version__ c.repo_name_cleaned = h.repo_name_slug(c.repo_name) - if check_repo(repo_name, g.base_path): + if check_repo(c.repo_name, g.base_path): return render('/errors/error_404.html') c.error_message = cgi.escape(request.GET.get('code', str(resp.status)))