diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-23 11:58:51 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-23 11:58:51 +0100 |
commit | cfa922295e5ddfaab336a3c2c0403422f77758b6 (patch) | |
tree | f24dcebc6214e2804646c04ff801886b8a11c4b5 /mediagoblin/plugins/api/views.py | |
parent | 785b287fcb42ac9130b222006097e3f68cec3543 (diff) | |
download | mediagoblin-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/plugins/api/views.py')
-rw-r--r-- | mediagoblin/plugins/api/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py index 8e02d7bd..3d9437e0 100644 --- a/mediagoblin/plugins/api/views.py +++ b/mediagoblin/plugins/api/views.py @@ -48,13 +48,13 @@ def post_entry(request): if request.method != 'POST': _log.debug('Must POST against post_entry') - return BadRequest() + raise BadRequest() if not 'file' in request.files \ or not isinstance(request.files['file'], FileStorage) \ or not request.files['file'].stream: _log.debug('File field not found') - return BadRequest() + raise BadRequest() media_file = request.files['file'] @@ -130,7 +130,7 @@ def post_entry(request): @api_auth def api_test(request): if not request.user: - return Forbidden() + raise Forbidden() user_data = { 'username': request.user.username, |