Niklas Rosencrantz
Niklas Rosencrantz

Reputation: 26652

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

Upvotes: 1

Views: 279

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599490

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(...

Upvotes: 3

Related Questions