# HG changeset patch # User Ronny Pfannschmidt # Date 2015-02-02 19:28:17 # Node ID 6f9dae4d39d9e651eb392927c7334da34c09a0fa # Parent d20ea885f6cb60c3c31facb5011b0ceae5508acb error controller: pep8 styling diff --git a/kallithea/controllers/error.py b/kallithea/controllers/error.py --- a/kallithea/controllers/error.py +++ b/kallithea/controllers/error.py @@ -32,7 +32,7 @@ import paste.fileapp from pylons import tmpl_context as c, request, config from pylons.i18n.translation import _ -from pylons.middleware import media_path +from pylons.middleware import media_path from kallithea.lib.base import BaseController, render @@ -50,7 +50,7 @@ class ErrorController(BaseController): """ def __before__(self): - #disable all base actions since we don't need them here + # disable all base actions since we don't need them here pass def document(self): @@ -60,12 +60,13 @@ class ErrorController(BaseController): log.debug('### %s ###' % (resp and resp.status or 'no response')) e = request.environ - c.serv_p = r'%(protocol)s://%(host)s/' \ - % {'protocol': e.get('wsgi.url_scheme'), - 'host': e.get('HTTP_HOST'), } - - c.error_message = resp and cgi.escape(request.GET.get('code', str(resp.status))) - c.error_explanation = resp and self.get_error_explanation(resp.status_int) + c.serv_p = r'%(protocol)s://%(host)s/' % { + 'protocol': e.get('wsgi.url_scheme'), + 'host': e.get('HTTP_HOST'), } + if resp: + c.error_message = cgi.escape(request.GET.get('code', + str(resp.status))) + c.error_explanation = self.get_error_explanation(resp.status_int) return render('/errors/error_document.html')