Commit 0ea92221 authored by Romain Courteaud's avatar Romain Courteaud :octopus:

erp5_xhtml_style: remove not needed cache

This case breaks action calculation between xhtml style and ERP5JS.
parent c649ed0d
master DateTime.equalTo_fix TMP-2to3 UserPropertySheet_backward_compatibility add_boolean_type arnau arnau-RD-py3-master-TM arnau-RD-py3-master-TM-BAK arnau-RD-py3-master-WIP arnau-RD-py3-master-WIP-BAK arnau-RD-py3-master-WIP-bt5-and-tests arnau-RD-zope4py3 arnau-my2to3 arnau-zope4py2 aurel-zope4py2 drop-ZServer e2e-erp5 erp5-component erp5-vifib erp5-vifib-no-Products.DCWorkflowGraph erp5-vifib-py3 erp5_drone_simulator feat/coding_style_test feat/dedup_roles_in_pickles feat/erp5pt feat/fsum feat/improve_rounding_tool feat/lxml-html-snapshot feat/mariadb-10.11 feat/mariadb-10.11bis feat/mariadb-10.11ter feat/mariadb-10.5 feat/mariadb-10.6 feat/mariadb-11.4bis feat/mariadb-11.4bis-old feat/mariadb-11.4ter feat/python_language_support feat/reindexlastobjects_log feat/round_half_up feat/selenium-unexpected-success feat/slapos_agent_distributor feat/subject_set_query fix/GHSA-g5vw-3h65-2q3v fix/TALES_hide_error fix/accounting-fec-no-line fix/erp5_site_global_id fix/mariadb-1927 fix/measure-optional-variation fix/monaco-altClick fix/officejs_support_request_rss_secu fix/state_var fix/testnode_proctitle fix/workflow_info fix/workflow_method_security fix_isIndexable for_testrunner_1 for_testrunner_2 for_testrunner_3 graphic_gadget_js oauth-login-minor-improvement poc/json-forms-study revert-192c2000 rfc/activate_default roque_quick support_legacy_sftp_server support_relative_url_in_hyperlink_field test_cmfactivity_isolation_level test_dynamic_methods tomo_testnode_slap_request translatable_path_master without_legacy_workflow workaround_mroonga_14 zope2 zope2zope4py2 zope4py3 zope4py3-BEFORE-CLEANUP zope4py3-master-rebase erp5.util-0.4.77 erp5.util-0.4.76 erp5.util-0.4.75 erp5.util-0.4.74 erp5.util-0.4.73 erp5.util-0.4.72 erp5.util-0.4.71 erp5-vifib-20240326 erp5-vifib-20230331 erp5-vifib-20230201 erp5-vifib-20220526 erp5-vifib-20220302
No related merge requests found
Pipeline #15161 failed with stage
in 0 seconds
......@@ -5,7 +5,6 @@ In case of duplicate, only the first action will be kept.
`actions` is the mapping returned by ActionsTool.listFilteredActionsFor
The script must be called on the context of the document.
"""
from Products.ERP5Type.Cache import CachingMethod
def filterDuplicateActions(actions):
new_actions = {}
......@@ -26,29 +25,6 @@ def filterDuplicateActions(actions):
return new_actions
def hasDuplicateActions(portal_type, user_name):
# Compare the count of action categories and actions
# Give every category a amount of 1000, as
# 'object_onlyxhtml_view' is transformed into 'object_view'
len_actions = 0
len_filtered_actions = 0
for cat in actions.values():
len_actions += 1000 + len(cat)
filtered_actions = filterDuplicateActions(actions)
for cat in filtered_actions.values():
len_filtered_actions += 1000 + len(cat)
return len_actions != len_filtered_actions
hasDuplicateActions = CachingMethod(
hasDuplicateActions,
id='Base_filterDuplicateActions.hasDuplicateActions',
cache_factory='erp5_ui_long')
user_name = getattr(container.REQUEST, 'AUTHENTICATED_USER', '')
if getattr(context, 'getPortalType', None) is not None:
if hasDuplicateActions(context.getPortalType(), user_name):
return filterDuplicateActions(actions)
return filterDuplicateActions(actions)
return actions
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