[Zope-PTK] Copying users to CMF

Jens Vagelpohl jens@digicool.com
Thu, 22 Feb 2001 10:29:31 -0500


priya,

i have attached a different copy_users.py file for you to use. replace the
current one in your Extensions directory with this one and don't forget to
hit "edit" to activate the changes in the "copy_users" external method in
your ZODB. please let me know how it works for you.

this new method works for me in a 2.3.0-based install and should work for
you as well.

background:
the traceback you see is because after adding a user to the target acl_users
folder zope tried to redirect you to that acl_users' management screen.
using not "manage_users" but the underlying "_addUser" method instead
allowed me to specify "REQUEST=None" and prevent this redirect.

why this did not fail in 2.3.0 before i am not sure... ;)

jens


On 2/21/01 23:01, "Priya Ramkumar" <pra@baba9.com> wrote:

> Hi Jens
> 
> Thanks for your response. This is the complete error message I get when
> using copy_users.
> 
> Zope Error
> Zope has encountered an error while publishing this resource.
> 
> Error Type: NameError
> Error Value: URL
> 
> Troubleshooting Suggestions
> 
> This resource may be trying to reference a nonexistent object or variable
> URL.
> The URL may be incorrect.
> The parameters passed to this resource may be incorrect.
> A resource that this resource relies on may be encountering an error.
> For more detailed information about the error, please refer to the HTML
> source for this page.
> 
> If the error persists please contact the site maintainer. Thank you for your
> patience.
> 
> Traceback (innermost last):
> File /export/usr/local/Zope-2.2.4-src/lib/python/ZPublisher/Publish.py,
> line 222, in publish_module
> File /export/usr/local/Zope-2.2.4-src/lib/python/ZPublisher/Publish.py,
> line 187, in publish
> File /export/usr/local/Zope-2.2.4-src/lib/python/Zope/__init__.py, line
> 221, in zpublisher_exception_hook
>   (Object: ApplicationDefaultPermissions)
> File /export/usr/local/Zope-2.2.4-src/lib/python/ZPublisher/Publish.py,
> line 171, in publish
> File /export/usr/local/Zope-2.2.4-src/lib/python/ZPublisher/mapply.py,
> line 160, in mapply
>   (Object: calltocopyusers)
> File /export/usr/local/Zope-2.2.4-src/lib/python/ZPublisher/Publish.py,
> line 112, in call_object
>   (Object: calltocopyusers)
> File /export/usr/local/Zope-2.2.4-src/lib/python/OFS/DTMLMethod.py, line
> 172, in __call__
>   (Object: calltocopyusers)
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/DocumentTemplate/DT_String.py,
> line 528, in __call__
>   (Object: calltocopyusers)
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/DocumentTemplate/DT_Util.py,
> line 337, in eval
>   (Object: copy_users('/intra/acl_users','/cmf/acl_users'))
>   (Info: copy_users)
> File <string>, line 0, in ?
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/Products/ExternalMethod/External
> Method.py, line 270, in __call__
>   (Object: copy_users)
>   (Info: (('/intra/acl_users', '/cmf/acl_users'), {}, None))
> File /export/usr/local/Zope-2.2.4-src/Extensions/copy_users.py, line 103,
> in copyUsers
>   (Object: ApplicationDefaultPermissions)
> File /export/usr/local/Zope-2.2.4-src/lib/python/AccessControl/User.py,
> line 663, in manage_users
>   (Object: RoleManager)
> File /export/usr/local/Zope-2.2.4-src/lib/python/AccessControl/User.py,
> line 595, in _addUser
>   (Object: RoleManager)
> File /export/usr/local/Zope-2.2.4-src/lib/python/App/special_dtml.py, line
> 120, in __call__
>   (Object: manage_main)
>   (Info:
> /export/usr/local/Zope-2.2.4-src/lib/python/AccessControl/mainUser.dtml)
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/DocumentTemplate/DT_String.py,
> line 528, in __call__
>   (Object: manage_main)
> File /export/usr/local/Zope-2.2.4-src/lib/python/App/special_dtml.py, line
> 120, in __call__
>   (Object: manage_tabs)
>   (Info: /export/usr/local/Zope-2.2.4-src/lib/python/App/manage_tabs.dtml)
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/DocumentTemplate/DT_String.py,
> line 528, in __call__
>   (Object: manage_tabs)
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/DocumentTemplate/DT_With.py,
> line 146, in render
>   (Object: _(manage_options=filtered_manage_options()))
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/DocumentTemplate/DT_In.py, line
> 691, in renderwob
>   (Object: manage_options)
> File
> /export/usr/local/Zope-2.2.4-src/lib/python/DocumentTemplate/DT_Util.py,
> line 337, in eval
>   (Object: URL[-(_.len(action)):]==action or
>               URL[-17:]=='/manage_workspace' and _['sequence-start'])
>   (Info: action)
> File <string>, line 0, in ?
> NameError: (see above)
> 
> Thanks
> Priya
> --------------------------
> 
> 
>> priya,
>> 
>> could you please send me the *complete* traceback that shows up? so far i
>> have not been able to reproduce this problem.
>> 
>> jens