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
Post a Comment