How to add plone group members from script -


i tried add plone user script ran "./bin/instance run myscript.py"

ipdb>app.plone.portal_groups.addprincipaltogroup('newuser', 'administrators') true 

but when check web interface user not added group.

although

ipdb>app.plone.portal_groups.getgroupmembers('administrators') ['newuser'] 

says otherwise.

when run same code in normal plone instance (by opening console http://localhost:8080/plone/ipdb) works.

do have commit changes made zodb or that?

you need commit transaction after doing changes

import transaction # things transaction.commit() 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -