Commit db1b0d91 authored by Roque's avatar Roque

erp5_hal_json_style: remove hack for a keyerror while handling actions

parent 52c142f3
......@@ -1414,19 +1414,13 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
for erp5_action_key in erp5_action_dict.keys():
erp5_action_list = []
for view_action in erp5_action_dict[erp5_action_key]:
continue_iteration = True
# Action condition is probably checked in Base_filterDuplicateActions
try:
erp5_action_list.append({
'href': '%s' % view_action['url'],
'href': view_action['url'] if ('url' in view_action) else '',
'name': view_action['id'],
'icon': view_action['icon'],
'icon': view_action['icon'] if ('icon' in view_action) else '',
'title': Base_translateString(view_action['title'])
})
except:
continue_iteration = False
if continue_iteration:
global_action_type = ("view", "workflow", "object_new_content_action",
"object_clone_action", "object_delete_action",
......@@ -2365,7 +2359,9 @@ try:
if hateoas["_embedded"]["_view"]["my_action"]["default"] == 'string:${object_url}/WebPage_viewAsJio' or hateoas["_embedded"]["_view"]["my_action"]["default"] == 'string:${object_url}/WebPage_view':
hateoas["_embedded"]["_view"]["my_action"]["default"] = 'portal_skins/erp5_officejs_jio_connector/WebPage_viewAsJio'
except:
except KeyError:
pass
except AttributeError:
pass
if hateoas == "":
return hateoas
......
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