equal
deleted
inserted
replaced
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
10 # FOR A PARTICULAR PURPOSE. |
10 # FOR A PARTICULAR PURPOSE. |
11 # |
11 # |
|
12 from pyams_cache.beaker import get_cache |
|
13 from pyams_portal.portlet import PORTLETS_CACHE_REGION, PORTLETS_CACHE_NAME |
12 |
14 |
13 __docformat__ = 'restructuredtext' |
15 __docformat__ = 'restructuredtext' |
14 |
16 |
15 |
17 |
16 # import standard library |
18 # import standard library |
501 editor = request.registry.queryMultiAdapter((portlet_config.editor_settings, request), |
503 editor = request.registry.queryMultiAdapter((portlet_config.editor_settings, request), |
502 IPagelet, name='properties.json') |
504 IPagelet, name='properties.json') |
503 if editor is None: |
505 if editor is None: |
504 raise NotFound() |
506 raise NotFound() |
505 changes = editor() |
507 changes = editor() |
|
508 # clear portlets cache on settings update |
|
509 if changes: |
|
510 portlets_cache = get_cache(PORTLETS_CACHE_REGION, PORTLETS_CACHE_NAME) |
|
511 portlets_cache.clear() |
|
512 # get edit output |
506 translate = self.request.localizer.translate |
513 translate = self.request.localizer.translate |
507 if changed_override or changes: |
514 if changed_override or changes: |
508 # we commit before loading previewer to avoid BLOBs "uncommitted changes" error |
515 # we commit before loading previewer to avoid BLOBs "uncommitted changes" error |
509 ITransactionManager(self.context).commit() |
516 ITransactionManager(self.context).commit() |
510 previewer = request.registry.queryMultiAdapter((self.context, request, self, portlet_config.settings), |
517 previewer = request.registry.queryMultiAdapter((self.context, request, self, portlet_config.settings), |