Moving things around a bit/commenting in the submit view to make the workflow clearer
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 11 Aug 2011 16:30:26 +0000 (11:30 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 11 Aug 2011 16:30:26 +0000 (11:30 -0500)
mediagoblin/submit/views.py

index d4858c8742286c3b6a270916177cc8c9a192bdb6..1e8c6a68a81a952cd05fb9d9ce3cf44c28efe3cd 100644 (file)
@@ -87,9 +87,13 @@ def submit_start(request):
             # Add queued filename to the entry
             entry['queued_media_file'] = queue_filepath
 
-            # queue it for processing
+            # Save now so we have this data before kicking off processing
+            entry.save(validate=False)
+
             result = process_media_initial.delay(unicode(entry['_id']))
-            entry['queued_task_id'] = result.task_id
+
+            # Save the task id
+            entry['queued_task_id'] = unicode(result.task_id)
             entry.save(validate=True)
 
             add_message(request, SUCCESS, _('Woohoo! Submitted!'))