Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
c53cda55
Commit
c53cda55
authored
Mar 22, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hal_json_style: error handling in hardcoded action value
parent
4f20e027
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+6
-5
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
c53cda55
...
...
@@ -1289,8 +1289,6 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
}
# Find current action URL and extract embedded view
log
(
"[DEBUG] getting action URL for traversed_document:"
);
log
(
traversed_document
)
erp5_action_dict
=
portal
.
Base_filterDuplicateActions
(
portal
.
portal_actions
.
listFilteredActionsFor
(
traversed_document
))
for
erp5_action_key
in
erp5_action_dict
.
keys
():
...
...
@@ -2166,9 +2164,12 @@ hateoas = calculateHateoas(is_portal=temp_is_portal, is_site_root=temp_is_site_r
form_relative_url=form_relative_url,
extra_param_json=extra_param_json)
# [HARDCODED] expresion string:${object_url} must be evaluated before return
if "_embedded" in hateoas.keys() and "_view" in hateoas["_embedded"].keys() and "my_action" in hateoas["_embedded"]["_view"].keys():
if hateoas["_embedded"]["_view"]["my_action"]["default"] == '
string
:
$
{
object_url
}
/
HTMLPost_viewAsJio
':
hateoas["_embedded"]["_view"]["my_action"]["default"] = '
portal_skins
/
erp5_officejs_jio_connector
/
HTMLPost_viewAsJio
'
try:
if "_embedded" in hateoas.keys() and "_view" in hateoas["_embedded"].keys() and "my_action" in hateoas["_embedded"]["_view"].keys():
if hateoas["_embedded"]["_view"]["my_action"]["default"] == '
string
:
$
{
object_url
}
/
HTMLPost_viewAsJio
':
hateoas["_embedded"]["_view"]["my_action"]["default"] = '
portal_skins
/
erp5_officejs_jio_connector
/
HTMLPost_viewAsJio
'
except:
pass
if hateoas == "":
return hateoas
else:
...
...
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