[Zope-CMF] Calling manage_users

Kevin Carlson khcarlso@bellsouth.net
Sat, 4 May 2002 14:12:02 -0400


No sooner did I post this than I realized there is a "roles" keyword in the
portal_membership.addMember method.  Never mind...

Kevin

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Kevin Carlson
Sent: Saturday, May 04, 2002 1:49 PM
To: zope-cmf group
Subject: [Zope-CMF] Calling manage_users


I am trying to change the default role of a portal member from "Member" to
"Foo" when the new member is created.  I have altered both the join_form
DTML method and the register python script to attempt this.

There is a select list in my custom join_form to allow the user to select a
role.  In register, I am trying to call manage_users after the user is
created (code below) but I am getting an attribute error.  There error is:

Error Type: AttributeError
Error Value: manage_users

I know this is saying that the attribute manage_users doesn't exist, but I
don't understand why.

The code I am using near the end of the register python script is:

    # alter role
    container.manage_users("Change", REQUEST)

I have also tried:


    # alter role
    context.manage_users("Change", REQUEST)

with identical results.

Any ideas?  Do I have to call this from an external script? Full traceback
below...

Thanks,

Kevin

--------------
Traceback (innermost last):
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 150, in publish_module
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 114, in publish
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/Zope/__init__.py, line
158, in zpublisher_exception_hook
    (Object: VerterisAdmin)
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 98, in publish
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/mapply.py,
line 88, in mapply
    (Object: register_copy)
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 39, in call_object
    (Object: register_copy)
  File
/usr/local/Zope-2.5.0-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py,
line 252, in __call__
    (Object: register_copy)
  File
/usr/local/Zope-2.5.0-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py,
line 283, in _bindAndExec
    (Object: register_copy)
  File
/usr/local/Zope-2.5.0-linux2-x86/lib/python/Products/PythonScripts/PythonScr
ipt.py, line 291, in _exec
    (Object: register_copy)
    (Info: ({'script': <PythonScript instance at 8b00470>, 'context':
<SkinnedFolder instance at 8af7048>, 'container': <SkinnedFolder
instance at 8af7048>, '_': <TemplateDict object at 0x8b22320>,
'traverse_subpath': []}, ('test', 'test'), {}, ('password', 'confirm')))
  File Script (Python), line 24, in register_copy
  File
/usr/local/Zope-2.5.0-linux2-x86/lib/python/AccessControl/ZopeGuards.py,
line 47, in guarded_getattr



_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf

See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests