Merge "Make webob.exc.HTTPForbidden return correct message"

This commit is contained in:
Jenkins 2014-02-26 12:58:43 +00:00 committed by Gerrit Code Review
commit 61638e48c5
2 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@ class Lockout(wsgi.Middleware):
failures = int(self.mc.get(failures_key) or 0)
if failures >= CONF.lockout_attempts:
detail = _("Too many failed authentications.")
raise webob.exc.HTTPForbidden(detail=detail)
raise webob.exc.HTTPForbidden(explanation=detail)
res = req.get_response(self.application)
if res.status_int == 403:
failures = self.mc.incr(failures_key)
@ -302,7 +302,7 @@ class Requestify(wsgi.Middleware):
if expired:
msg = _("Timestamp failed validation.")
LOG.exception(msg)
raise webob.exc.HTTPForbidden(detail=msg)
raise webob.exc.HTTPForbidden(explanation=msg)
# Raise KeyError if omitted
action = req.params['Action']

View File

@ -285,7 +285,7 @@ class Application(object):
res = 'message\n'
# Option 2: a nicely formatted HTTP exception page
res = exc.HTTPForbidden(detail='Nice try')
res = exc.HTTPForbidden(explanation='Nice try')
# Option 3: a webob Response object (in case you need to play with
# headers, or you want to be treated like an iterable, or or or)