Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
5a0d4baf
Commit
5a0d4baf
authored
Sep 30, 2015
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_data_notebook bt5: Add exception handling while serializing result
parent
f807b0b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/Base_executeJupyter.xml
...m/portal_skins/erp5_data_notebook/Base_executeJupyter.xml
+15
-7
No files found.
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/Base_executeJupyter.xml
View file @
5a0d4baf
...
@@ -61,12 +61,9 @@
...
@@ -61,12 +61,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.CMFActivity.ActiveResult import ActiveResult\n
<value>
<string>
import json\n
import json\n
\n
\n
selection_id = \'python_shell_selection\'\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
portal_selections = portal.portal_selections\n
\n
\n
# The boolean values via requests are received as \n
# The boolean values via requests are received as \n
request_reference = {\'True\': True, \'False\': False}.get(request_reference, False)\n
request_reference = {\'True\': True, \'False\': False}.get(request_reference, False)\n
...
@@ -129,9 +126,20 @@ result = {\n
...
@@ -129,9 +126,20 @@ result = {\n
u\'status\': status\n
u\'status\': status\n
}\n
}\n
\n
\n
data_notebook_message.edit(notebook_code_result=code_result)\n
try:\n
\n
serialized_result = json.dumps(result)\n
return json.dumps(result)\n
data_notebook_message.edit(notebook_code_result=code_result)\n
except UnicodeDecodeError:\n
result = {\n
u\'code_result\': None,\n
u\'ename\': u\'UnicodeDecodeError\',\n
u\'evalue\': None,\n
u\'traceback\': None,\n
u\'status\': u\'error\'\n
}\n
serialized_result = json.dumps(result)\n
\n
return serialized_result\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment