Plone memberdata更新:未触发PropertiesUpdatedEvent

jtm*_*lon 6 python events zope plone event-handling

我正在尝试在@@ personal-information上更新成员属性后执行操作,但事件未被触发.在configure.zcml上我放了以下内容:

<subscriber
    for="Products.PluggableAuthService.interfaces.events.IPropertiesUpdatedEvent"
    handler=".subscribers.propertiesUpdated"
/>
Run Code Online (Sandbox Code Playgroud)

我已经尝试使用ipdb检查subscriber.py的propertiesUpdated是否正在执行,但事实并非如此.

我已经检查了https://bugs.launchpad.net/zope-pas/+bug/795086错误报告,该报告说这个错误已经修复,但它仍然无效.

我正在使用PluggableAuthService 1.10.0.

有没有更好的方法来解决这个问题?

小智 2

PropertiesUpdated 事件(实现 IPropertiesUpdatedEvent)不会在 Plone 代码中触发(查看 Plone 4.3)。

更改帐户信息后触发的唯一事件是plone.app.controlpanel.events.ConfigurationChangedEvent。您可能想要订阅该事件和过滤器(因为该事件是在很多地方触发的通用事件)。

为了知道某个操作后会触发哪些事件,我所做的就是:在 zope.event.notify ( print event, event.__dict__) 中添加一条打印语句并以前台模式启动。

您可能想在https://dev.plone.org上请求增强功能或更好地实现它。plone.app.users 包是一个很好的起点。