Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Error in Development Server When Logging in #298

Open
gadgster opened this issue Jul 14, 2014 · 2 comments
Open

Type Error in Development Server When Logging in #298

gadgster opened this issue Jul 14, 2014 · 2 comments

Comments

@gadgster
Copy link

Hello,

The first time I ran GAE Boilerplate, I clicked on login using your Google account and got a type error:

File "models.py", line 35, in <lambda> full_name = ndb.ComputedProperty(lambda self: self.name + " " + self.last_name) TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

I fixed this by changing line 35 in models.py to:

full_name = ndb.ComputedProperty(lambda self: "{} {}".format(self.name, self.last_name,))

I'm not sure if that's actually fixing the problem or just avoiding it.

Thanks
Richard

@andrewgreensmith
Copy link
Contributor

Hi,
I'm guessing you don't actually have a "name" or "last_name" since you signed in with google. I sort of got round this in my application by having a display name too and never refer to full name directly since I always want to show something.
@Property
def display_name(self):
if self.name or self.last_name:
return self.full_name
else:
return self.username

hope that helps,
I should really get round to sticking some of my updates onto my fork :)

@gadgster
Copy link
Author

I think changing line 35 of models.py to:

full_name = ndb.ComputedProperty(lambda self: "{} {}".format(self.name, self.last_name,))

Would fix this.

coto added a commit that referenced this issue Sep 29, 2014
Updated pytz to 2014.7. Fixed Travis CI, #298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants