I’m using Plone 4.1 and collective.externaleditor. I would like that whenever a new user is created, his personal preference ext_editor be set to True.
I made a subscriber to the user creation event, but I can’t change that property:
configure.zcml:
...
<subscriber
for="Products.PluggableAuthService.interfaces.events.IPrincipalCreatedEvent"
handler=".events.newUser"
/>
events.py:
from zope.app.component.hooks import getSite
from Products.CMFCore.utils import getToolByName
def newUser(user):
'''Sets external editor property to True for new users.'''
mtool = getToolByName(getSite(), 'portal_membership')
# what should i put here?
user.principal.setProperties({'ext_editor': True})
newUser isn’t doing its work. user.principal’s type is Ploneuser. It doesn’t have a setMemberProperties method, so I don’t know what to do.
collective.externaleditor add a property ‘ext_editor’ to control panel too, so I could change it programmatically.
How can I set ext_editor to True for new created users?
Thanks.
Here’s the answer I found.
profiles/default/memberdata_properties.xml: