Commit 23435825 authored by Romain Courteaud's avatar Romain Courteaud Committed by Cédric de Saint Martin

Use the json lib instead of doing it manually

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