[Zope] Python error: object does not support item or slice assignment

Florian Lindner Florian.Lindner at xgm.de
Fri Sep 26 07:46:44 EDT 2003


Hello,
I want to write a login script which authentificates with a 
exUserFolder. But I get this error message:

Zope has encountered an error while publishing this resource.
Error Type: TypeError
Error Value: object does not support item or slice assignment

The Log says that the error is on line 5, marked with <--.


## Script (Python) "loginUser"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=REQUEST=None
##title=
##
if REQUEST == None:
  REQUEST = context.REQUEST
RESPONSE =  REQUEST.RESPONSE

REQUEST['__ac_name'] = REQUEST['username'] <--
REQUEST['__ac_password'] = REQUEST['password']

try: # Login successfull.
   userObject = self.acl_users.validate(REQUEST)
   RESPONSE.redirect('loginok.zpt')

except:  # Login failed...
   authFailedCode=REQUEST.get('authFailedCode', '')
   RESPONSE.redirect('loginfailed.zpt?authFailedCode=%s'%(authFailedCode))

What is wrong?

Thx,
Florian




More information about the Zope mailing list