Commit b7b49b2e authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner: Response body may contain a local reference of the uploaded image

The http response should return a 200 response in case of success. The response body may contain a local reference of the uploaded image
parent 0f394f37
......@@ -2,6 +2,17 @@
We need proy role as manager to create a new active process
and post active result
"""
import string
import random
reference = str(
DateTime().millis()) + '-' + ''.join(
random.sample(
string.letters+string.digits, random.randint(
6, 10)
)
)
portal = context.getPortalObject()
if REQUEST:
......@@ -12,6 +23,5 @@ if active_process_url:
else:
active_process = portal.portal_activities.newActiveProcess()
active_process.postActiveResult(detail=detail)
return active_process
active_process.postActiveResult(detail=detail, reference=reference)
return active_process, reference
......@@ -30,7 +30,7 @@ if not image_str:
return context.Base_renderForm('Base_viewUploadDocumentFromCameraDialog',
message=translateString('Nothing to capture'))
active_process = context.Base_postDataToActiveResult(
active_process, _ = context.Base_postDataToActiveResult(
active_process_url,
image_str)
......
return context.REQUEST
import json
_, reference = context.Base_postDataToActiveResult(
active_process_url, input_value)
return json.dumps({"reference": reference})
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>input_value, active_process_url, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment