##// END OF EJS Templates
fixed path error for error controller
marcink -
r352:76f8bef6 default
parent child Browse files
Show More
@@ -38,10 +38,14 b' class ErrorController(BaseController):'
38
38
39 if resp.status_int == 404:
39 if resp.status_int == 404:
40 org_e = request.environ.get('pylons.original_request').environ
40 org_e = request.environ.get('pylons.original_request').environ
41 c.repo_name = repo_name = org_e['PATH_INFO'].split('/')[1]
41 try:
42 c.repo_name = org_e['PATH_INFO'].split('/')[1]
43 except IndexError:
44 c.repo_name = ''
45
42 c.hg_app_version = __version__
46 c.hg_app_version = __version__
43 c.repo_name_cleaned = h.repo_name_slug(c.repo_name)
47 c.repo_name_cleaned = h.repo_name_slug(c.repo_name)
44 if check_repo(repo_name, g.base_path):
48 if check_repo(c.repo_name, g.base_path):
45 return render('/errors/error_404.html')
49 return render('/errors/error_404.html')
46
50
47 c.error_message = cgi.escape(request.GET.get('code', str(resp.status)))
51 c.error_message = cgi.escape(request.GET.get('code', str(resp.status)))
General Comments 0
You need to be logged in to leave comments. Login now