-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from plone/configuration-changed-event
Remove ConfigurationChangedEvent.
- Loading branch information
Showing
4 changed files
with
8 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,4 @@ | |
|
||
<include file="permissions.zcml" /> | ||
|
||
<subscriber handler=".events.handleConfigurationChangedEvent" /> | ||
|
||
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
from zope.component import adapter | ||
from zope.component import queryUtility | ||
from zope.interface import implements | ||
from zope.ramcache.interfaces.ram import IRAMCache | ||
|
||
from plone.app.controlpanel.interfaces import IConfigurationChangedEvent | ||
|
||
|
||
class ConfigurationChangedEvent(object): | ||
implements(IConfigurationChangedEvent) | ||
|
||
def __init__(self, context, data): | ||
self.context = context | ||
self.data = data | ||
|
||
|
||
@adapter(IConfigurationChangedEvent) | ||
def handleConfigurationChangedEvent(event): | ||
util = queryUtility(IRAMCache) | ||
if util is not None: | ||
util.invalidateAll() | ||
# Control panels for Plone 5 have been moved to CMFPlone. We keep those imports | ||
# for backwards compatibility. | ||
from Products.CMFPlone.interfaces import IConfigurationChangedEvent # noqa | ||
from Products.CMFPlone.controlpanel.event import ConfigurationChangedEvent # noqa | ||
from Products.CMFPlone.controlpanel.event import handleConfigurationChangedEvent # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters