# HG changeset patch # User Thierry Florac # Date 1529591892 -7200 # Node ID 1cee610aecceee5367d474e7a5501338bbbafddb # Parent 7ad82c70e528f2bc6601b6a9c3e0638558ad8cff Clear portlets cache on any portlet modification diff -r 7ad82c70e528 -r 1cee610aecce src/pyams_portal/zmi/layout.py --- a/src/pyams_portal/zmi/layout.py Thu Jun 21 16:37:36 2018 +0200 +++ b/src/pyams_portal/zmi/layout.py Thu Jun 21 16:38:12 2018 +0200 @@ -9,6 +9,8 @@ # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # +from pyams_cache.beaker import get_cache +from pyams_portal.portlet import PORTLETS_CACHE_REGION, PORTLETS_CACHE_NAME __docformat__ = 'restructuredtext' @@ -503,6 +505,11 @@ if editor is None: raise NotFound() changes = editor() + # clear portlets cache on settings update + if changes: + portlets_cache = get_cache(PORTLETS_CACHE_REGION, PORTLETS_CACHE_NAME) + portlets_cache.clear() + # get edit output translate = self.request.localizer.translate if changed_override or changes: # we commit before loading previewer to avoid BLOBs "uncommitted changes" error