[FIX] the data must be JSON-encoded when we call the document/upload endpoint. Need to build the body instead of data and files params

This commit is contained in:
Guewen Baconnier @ Camptocamp
2012-11-23 12:15:00 +01:00
parent 8bb9c3bb77
commit b88f5c556a
2 changed files with 33 additions and 12 deletions

View File

@@ -91,10 +91,14 @@ class pingen_task(orm.Model):
success = False
# parameterize
pingen = Pingen(TOKEN, staging=True)
doc = (task.datas_fname, StringIO(decoded_document))
doc = (task.datas_fname, )
try:
doc_id, post_id, __ = pingen.push_document(
doc, task.pingen_send, task.pingen_speed, task.pingen_color)
task.datas_fname,
StringIO(decoded_document),
task.pingen_send,
task.pingen_speed,
task.pingen_color)
except ConnectionError as e:
# we can continue and it will be retried the next time
_logger.exception('Connection Error when pushing Pingen Task %s to %s.' %