[Zope] Please Help! Wierd error that wasn't there before...
Rob Foster
rob@thefosters.com
Sun, 4 Nov 2001 00:13:49 -0700
--Apple-Mail-1-781025838
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
I had this working before... a user fills out a form which posts to a
script which in turn creates a new user. Now, when a user is created in
acl_users and when I click on it, I get the error below... I've tried
changing the roles, moving the acl_users directory and changing the
python script, all to no avail. The Zope user stuff is becoming really
frustrating. I could use some help. Thanks in advance.
BEGIN ERROR
----------------------------------------
'in ' requires character as left operand
Traceback (innermost last):
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 223, in publish_module
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 187, in publish
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/Zope/__init__.py, line
226, in zpublisher_exception_hook
(Object: RoleManager)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 171, in publish
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: manage_users)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: manage_users)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/AccessControl/User.py,
line 860, in manage_users
(Object: RoleManager)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/Shared/DC/Scripts/Bindings.
py, line 324, in __call__
(Object: _editUser)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/Shared/DC/Scripts/Bindings.
py, line 354, in _bindAndExec
(Object: _editUser)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/App/special_dtml.py,
line 244, in _exec
(Object: _editUser)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/DocumentTemplate/DT_In.py,
line 770, in renderwob
(Object: valid_roles)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/DocumentTemplate/DT_Util.
py, line 231, in eval
(Object: _vars['sequence-item'] in user.roles)
(Info: _vars)
File <string>, line 0, in ?
TypeError: (see above)
--------------------------------------------
END ERROR
Here's the source for the python script that creates the user:
#These two lines of code are generated automatically when you create a
new script... just leave them there.
request = container.REQUEST
RESPONSE = request.RESPONSE
#This line of code looks to see if there is already a user in the
acl_users folder...
if context.acl_users.getUser(request.form['name']):
#If it finds someone with that name, you can send the user to a page
with the following line...
RESPONSE.redirect('index_html?user=exists')
return
#If it doesn't find anyone, it moves to the following line which checks
to make sure the password and confirmation fields are identical...
if request.form['password'] <> request.form['confirm']:
#If the fields don't match, you can forward the user to another page and
tell them...
RESPONSE.redirect('index_html?passwords=dontmatch')
return
#If everything checks out, this next line finally adds the user...
context.acl_users.manage_users('Add', context.REQUEST)
#You can then use this last line to forward to yet another page with a
confirmation...
RESPONSE.redirect('signup2')
--Apple-Mail-1-781025838
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
charset=US-ASCII
I had this working before... a user fills out a form which posts to a
script which in turn creates a new user. Now, when a user is created
in acl_users and when I click on it, I get the error below... I've
tried changing the roles, moving the acl_users directory and changing
the python script, all to no avail. The Zope user stuff is becoming
really frustrating. I could use some help. Thanks in advance.
BEGIN ERROR
----------------------------------------
<fontfamily><param>Arial</param><color><param>3333,3333,3333</param>'in
' requires character as left operand </color></fontfamily><fontfamily><param>Times New Roman</param><bigger><bigger>
</bigger></bigger></fontfamily><fixed><fontfamily><param>Courier New</param>
Traceback (innermost last):
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 223, in publish_module
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 187, in publish
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/Zope/__init__.py,
line 226, in zpublisher_exception_hook
(Object: RoleManager)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 171, in publish
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: manage_users)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: manage_users)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/AccessControl/User.py,
line 860, in manage_users
(Object: RoleManager)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/Shared/DC/Scripts/Bindings.py,
line 324, in __call__
(Object: _editUser)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/Shared/DC/Scripts/Bindings.py,
line 354, in _bindAndExec
(Object: _editUser)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/App/special_dtml.py,
line 244, in _exec
(Object: _editUser)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/DocumentTemplate/DT_In.py,
line 770, in renderwob
(Object: valid_roles)
File
/Users/rfoster/Desktop/Zope-2.4.1-MOSX/lib/python/DocumentTemplate/DT_Util.py,
line 231, in eval
(Object: _vars['sequence-item'] in user.roles)
(Info: _vars)
File <<string>, line 0, in ?
TypeError: (see above)
</fontfamily></fixed>--------------------------------------------
END ERROR
Here's the source for the python script that creates the user:
#These two lines of code are generated automatically when you create a
new script... just leave them there.
request = container.REQUEST
RESPONSE = request.RESPONSE
#This line of code looks to see if there is already a user in the
acl_users folder...
if context.acl_users.getUser(request.form['name']):
#If it finds someone with that name, you can send the user to a page
with the following line...
RESPONSE.redirect('index_html?user=exists')
return
#If it doesn't find anyone, it moves to the following line which
checks to make sure the password and confirmation fields are
identical...
if request.form['password'] <<> request.form['confirm']:
#If the fields don't match, you can forward the user to another page
and tell them...
RESPONSE.redirect('index_html?passwords=dontmatch')
return
#If everything checks out, this next line finally adds the user...
context.acl_users.manage_users('Add', context.REQUEST)
#You can then use this last line to forward to yet another page with a
confirmation...
RESPONSE.redirect('signup2')
--Apple-Mail-1-781025838--