Convert return HttpException to raise HttpException

controllers (view function) raise HttpException's and do not return them.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-12-23 11:58:51 +01:00
parent 785b287fcb
commit cfa922295e
6 changed files with 15 additions and 14 deletions

View File

@@ -130,7 +130,7 @@ class CsrfMeddleware(BaseMeddleware):
# the CSRF cookie must be present in the request
errstr = 'CSRF cookie not present'
_log.error(errstr)
return Forbidden(errstr)
raise Forbidden(errstr)
# get the form token and confirm it matches
form = CsrfForm(request.form)
@@ -145,4 +145,4 @@ class CsrfMeddleware(BaseMeddleware):
# present; either way, the request is denied
errstr = 'CSRF validation failed'
_log.error(errstr)
return Forbidden(errstr)
raise Forbidden(errstr)