Commit 7b3cbc2c authored by Romain Courteaud's avatar Romain Courteaud

Use the json lib instead of doing it manually

parent 4988229b
......@@ -50,19 +50,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>import json\n
person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
if person is not None:\n
result_list = context.AcknowledgementTool_getUserUnreadAcknowledgementList()\n
if len(result_list):\n
<value> <string>result_list = context.AcknowledgementTool_getUserUnreadAcknowledgementList()\n
if len(result_list):\n
result_list = [result_list[0]]\n
\n
\n
result = {\n
import json\n
result = {\n
"result": [{"text_content": "%s" % x[\'text_content\'], "acknowledge_url": "%s" % x[\'acknowledge_url\']} for x in result_list]\n
}\n
else:\n
result = {\'result\': []}\n
}\n
\n
context.REQUEST.RESPONSE.setHeader(\'Content-Type\', \'application/json\')\n
return json.dumps(result)\n
......
435
\ No newline at end of file
436
\ No newline at end of file
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