We should save the entry *after* we add the queued_task_id.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 11 Aug 2011 01:26:22 +0000 (20:26 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 11 Aug 2011 01:26:22 +0000 (20:26 -0500)
mediagoblin/submit/views.py

index 59d8fe3f4e318b74cb0c97f09351bd22621eb1ca..537112364bbcf9b8ed4a5b4b9a62037f88765d5a 100644 (file)
@@ -88,11 +88,11 @@ def submit_start(request):
 
             # Add queued filename to the entry
             entry['queued_media_file'] = queue_filepath
-            entry.save(validate=True)
 
             # queue it for processing
             result = process_media_initial.delay(unicode(entry['_id']))
             entry['queued_task_id'] = result.task_id
+            entry.save(validate=True)
 
             add_message(request, SUCCESS, _('Woohoo! Submitted!'))