whenever i try to use <dtml-call "manage_users([submit, REQUEST, RESPONSE])"> , i fail miserably, getting the following error and the traceback below .. Error Type: NameError Error Value: URL I think submit and REQUEST both are ok.. submit = 'Add' and REQUEST contains name, password, confirm, roles and domains.. Please help.. I asked about a similar problem a couple of weeks ago, but nobody answered. I've tried everything i can think of. Nothing seems to work.. ------------------------------------------------ Geir B Hansen geirh@funcom.com Web-designer / Graphic artist Funcom Oslo http://www.funcom.com ------------------------------------------------ ------- traceback follows : Traceback (innermost last): File /usr/local/funcom/intranett/python/Zope2/lib/python/ZPublisher/Publish.p y, line 214, in publish_module File /usr/local/funcom/intranett/python/Zope2/lib/python/ZPublisher/Publish.p y, line 179, in publish File /usr/local/funcom/intranett/python/Zope2/lib/python/Zope/__init__.py, line 211, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/funcom/intranett/python/Zope2/lib/python/ZPublisher/Publish.p y, line 165, in publish File /usr/local/funcom/intranett/python/Zope2/lib/python/ZPublisher/mapply.py , line 160, in mapply (Object: create) File /usr/local/funcom/intranett/python/Zope2/lib/python/ZPublisher/Publish.p y, line 102, in call_object (Object: create) File /usr/local/funcom/intranett/python/Zope2/lib/python/OFS/DTMLMethod.py, line 145, in __call__ (Object: create) File /usr/local/funcom/intranett/python/Zope2/lib/python/DocumentTemplate/DT_ String.py, line 502, in __call__ (Object: create) File /usr/local/funcom/intranett/python/Zope2/lib/python/DocumentTemplate/DT_ Util.py, line 335, in eval (Object: manage_users([submit, REQUEST, RESPONSE])) (Info: manage_users) File <string>, line 0, in ? File /usr/local/funcom/intranett/python/Zope2/lib/python/AccessControl/User.p y, line 601, in manage_users (Object: RoleManager) File /usr/local/funcom/intranett/python/Zope2/lib/python/App/special_dtml.py, line 120, in __call__ (Object: manage_main) (Info: /usr/local/funcom/intranett/python/Zope2/lib/python/AccessControl/mainUs er.dtml) File /usr/local/funcom/intranett/python/Zope2/lib/python/DocumentTemplate/DT_ String.py, line 502, in __call__ (Object: manage_main) File /usr/local/funcom/intranett/python/Zope2/lib/python/App/special_dtml.py, line 120, in __call__ (Object: manage_tabs) (Info: /usr/local/funcom/intranett/python/Zope2/lib/python/App/manage_tabs.dtml ) File /usr/local/funcom/intranett/python/Zope2/lib/python/DocumentTemplate/DT_ String.py, line 502, in __call__ (Object: manage_tabs) File /usr/local/funcom/intranett/python/Zope2/lib/python/DocumentTemplate/DT_ With.py, line 148, in render (Object: _(manage_options=filtered_manage_options())) File /usr/local/funcom/intranett/python/Zope2/lib/python/DocumentTemplate/DT_ In.py, line 691, in renderwob (Object: manage_options) File /usr/local/funcom/intranett/python/Zope2/lib/python/DocumentTemplate/DT_ Util.py, line 335, 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)
From your post <dtml-call "manage_users([submit, REQUEST, RESPONSE])"> part of the problem is that you call manager_users as a generic function call. Remember manage_users is a method of an object (acl_users.manage_users). Give this a try, and let me know if you still need help.
<dtml-call "REQUEST.set('name', user_id)"> <dtml-call "REQUEST.set('password', password)"> <dtml-call "REQUEST.set('confirm', confirm)"> <dtml-call "REQUEST.set('roles', roles)"> <dtml-call "acl_users.manage_users(submit='Add', REQUEST=REQUEST)"> DR
Works like a wonder now ! Thanks a lot.. ( i still wonder why you use REQUEST = REQUEST in the call, though .. Am i just being stupid ? ) ------------------------------------------------ Geir B Hansen geirh@funcom.com Web-designer / Graphic artist Funcom Oslo http://www.funcom.com ------------------------------------------------
From your post <dtml-call "manage_users([submit, REQUEST, RESPONSE])"> part of the problem is that you call manager_users as a generic function call. Remember manage_users is a method of an object (acl_users.manage_users). Give this a try, and let me know if you still need help.
<dtml-call "REQUEST.set('name', user_id)"> <dtml-call "REQUEST.set('password', password)"> <dtml-call "REQUEST.set('confirm', confirm)"> <dtml-call "REQUEST.set('roles', roles)"> <dtml-call "acl_users.manage_users(submit='Add', REQUEST=REQUEST)">
DR
( i still wonder why you use REQUEST=REQUEST in the call, though .. Am i just being stupid ? ) Basically, you have two choices in argument lists: assignment pairs i.e. REQUEST=REQUEST or good old fashion parameters like you were attempting i.e ('Add', REQUEST, RESPONSE). The only cavet is that you can't mix the two, once you pass assignment pairs all arguments must be assignement pairs.... additionally, in the ZQR if an argument is in a bracket [] it is optional... DR
participants (2)
-
Daniel G. Rusch -
Geir B Hansen