aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/api/views.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2012-12-26 23:40:42 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-12-26 23:42:26 +0100
commitb228d89715558281d9573543dd0d6c74836d42ca (patch)
tree858aeb502482ac2cda3b41acc176b21e9a606250 /mediagoblin/plugins/api/views.py
parent01986008f66a1899d415a186c688f3056f6d8e6b (diff)
downloadmediagoblin-b228d89715558281d9573543dd0d6c74836d42ca.tar.lz
mediagoblin-b228d89715558281d9573543dd0d6c74836d42ca.tar.xz
mediagoblin-b228d89715558281d9573543dd0d6c74836d42ca.zip
prepare_queue_task: Take app not request.
First rename prepare_entry to prepare_queue_task, because this is really more like what this thing does. Thanks to Velmont for noting that we do not need a request in here, but an "app" is good enough. Which means, that this stuff can be called from tool scripts too.
Diffstat (limited to 'mediagoblin/plugins/api/views.py')
-rw-r--r--mediagoblin/plugins/api/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py
index e8f64574..0991297d 100644
--- a/mediagoblin/plugins/api/views.py
+++ b/mediagoblin/plugins/api/views.py
@@ -27,7 +27,7 @@ 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_entry, run_process_media
+from mediagoblin.submit.lib import prepare_queue_task, run_process_media
_log = logging.getLogger(__name__)
@@ -68,7 +68,7 @@ def post_entry(request):
entry.generate_slug()
# queue appropriately
- queue_file = prepare_entry(request, entry, media_file.filename)
+ queue_file = prepare_queue_task(request.app, entry, media_file.filename)
with queue_file:
queue_file.write(request.files['file'].stream.read())