Search code examples
pythongoogle-app-enginewebapp2

How to use the expando properties for a User object in webapp2?


I'm trying to use to expando proprties of the User object:

    user = self.auth.store.user_model.create_user(username, password_raw=password)
    user.name = username

But I receive an error message:

    user.name = username
    AttributeError: 'tuple' object has no attribute 'name'

How should I do this for a User object instead of a tuple?

Thanks


Solution

  • create_user returns a tuple of created, user - the first is a boolean flag which shows whether or not the object was created.

    created, user = self.auth.store.user_model.create_user(...