Added support for http callbacks on processing

Sends an HTTP POST request back to an URL given on submission to the API
submit view.
This commit is contained in:
Joar Wandborg
2012-09-24 23:47:32 +02:00
parent 20d01daed7
commit 5354f954dc
5 changed files with 111 additions and 2 deletions

View File

@@ -98,6 +98,12 @@ def post_entry(request):
# Save now so we have this data before kicking off processing
entry.save(validate=True)
if request.POST.get('callback_url'):
metadata = request.db.ProcessingMetaData()
metadata.media_entry = entry
metadata.callback_url = unicode(request.POST['callback_url'])
metadata.save()
# Pass off to processing
#
# (... don't change entry after this point to avoid race