Saving attributes for a DataSkin
Hi, I'm having some trouble figuring out how to write a method and a skinscript to save attributes of a DataSkin. Specialist is the LoginManager. DataSkin is: class EasyGroupUser(LoginUser): ... def getRoles(self): ... def getDomains(self): ... def authenticate(self, password, request): ... SkinScripts are: WITH QUERY sql_getUserFor(username=self.id) COMPUTE username, password, challenge_question, challenge_answer, admin_email WHEN OBJECT CHANGED STORE password, challenge_question, challenge_answer, admin_email USING sql_changeUser( username=self.id, newpassword=password, challenge_question=challenge_question, challenge_answer=challenge_answer, admin_email=admin_email, oldpassword=OLD['oldpassword'] ) SAVING oldpassword = password Current Attribute Handling: admin_email Getters: SkinScript, line 1 Setters: SkinScript, line 10 Deleters: SkinScript, line 10 challenge_answer Getters: SkinScript, line 1 Setters: SkinScript, line 10 Deleters: SkinScript, line 10 challenge_question Getters: SkinScript, line 1 Setters: SkinScript, line 10 Deleters: SkinScript, line 10 password Getters: SkinScript, line 1 Setters: SkinScript, line 10 Deleters: SkinScript, line 10 The getter works alright, but when trying to set attributes (that supposedly would be handle by the setter) with the following Script (Python) I get the following error: ## Script (Python) "changeUser" ##bind container=container ##bind context=context ##bind namespace=self ##bind script=script ##bind subpath=traverse_subpath ##parameters=username,password,challenge_question,challenge_answer,admin_email ##title= ## user = context.getItem(username) user.password=password user.challenge_question=challenge_question user.challenge_answer=challenge_answer user.admin_email=admin_email ERROR MESSAGE: Error Type: TypeError Error Value: attribute-less object (assign or del) So what am I doing wrong here? Any clues appreciated. TIA/Johan Carlsson
participants (1)
-
Johan Carlsson