src/pyams_portal/zmi/layout.py
changeset 134 1cee610aecce
parent 121 a7c7efdc532b
child 136 a1aaac7979e9
--- 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