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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user