aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/meddleware/csrf.py
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-23 11:58:51 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-23 11:58:51 +0100
commitcfa922295e5ddfaab336a3c2c0403422f77758b6 (patch)
treef24dcebc6214e2804646c04ff801886b8a11c4b5 /mediagoblin/meddleware/csrf.py
parent785b287fcb42ac9130b222006097e3f68cec3543 (diff)
downloadmediagoblin-cfa922295e5ddfaab336a3c2c0403422f77758b6.tar.lz
mediagoblin-cfa922295e5ddfaab336a3c2c0403422f77758b6.tar.xz
mediagoblin-cfa922295e5ddfaab336a3c2c0403422f77758b6.zip
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>
Diffstat (limited to 'mediagoblin/meddleware/csrf.py')
-rw-r--r--mediagoblin/meddleware/csrf.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mediagoblin/meddleware/csrf.py b/mediagoblin/meddleware/csrf.py
index 65db9827..2984ebb9 100644
--- a/mediagoblin/meddleware/csrf.py
+++ b/mediagoblin/meddleware/csrf.py
@@ -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)