diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-03-29 08:09:36 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-03-29 08:09:36 -0500 |
commit | 047d8d5871ee8ee97ea52a78512fe5b2da51b8cc (patch) | |
tree | c8bdf7e4ebb83ee8dd25930459c33084cd434ac6 /mediagoblin/plugins/api/views.py | |
parent | 6c6e9911f5556bcd1f287afa39d4cc6d14d9c6c1 (diff) | |
parent | 2ef2f46e73845dcd55666cad49c5a17908bf5b46 (diff) | |
download | mediagoblin-047d8d5871ee8ee97ea52a78512fe5b2da51b8cc.tar.lz mediagoblin-047d8d5871ee8ee97ea52a78512fe5b2da51b8cc.tar.xz mediagoblin-047d8d5871ee8ee97ea52a78512fe5b2da51b8cc.zip |
Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin
Diffstat (limited to 'mediagoblin/plugins/api/views.py')
-rw-r--r-- | mediagoblin/plugins/api/views.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py index 2055a663..fde76fe4 100644 --- a/mediagoblin/plugins/api/views.py +++ b/mediagoblin/plugins/api/views.py @@ -18,7 +18,6 @@ import json import logging from os.path import splitext -from werkzeug.datastructures import FileStorage from werkzeug.exceptions import BadRequest, Forbidden from werkzeug.wrappers import Response @@ -27,7 +26,8 @@ from mediagoblin.meddleware.csrf import csrf_exempt from mediagoblin.media_types import sniff_media from mediagoblin.plugins.api.tools import api_auth, get_entry_serializable, \ json_response -from mediagoblin.submit.lib import prepare_queue_task, run_process_media +from mediagoblin.submit.lib import check_file_field, prepare_queue_task, \ + run_process_media _log = logging.getLogger(__name__) @@ -45,9 +45,7 @@ def post_entry(request): _log.debug('Must POST against post_entry') raise BadRequest() - if not 'file' in request.files \ - or not isinstance(request.files['file'], FileStorage) \ - or not request.files['file'].stream: + if not check_file_field(request, 'file'): _log.debug('File field not found') raise BadRequest() |