juliankmazo / webapp-improved

Automatically exported from code.google.com/p/webapp-improved
Other
0 stars 0 forks source link

webapp2_extras.appengine.auth.models.User.validate_token returns Bool instead of an entity #102

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call webapp2_extras.appengine.auth.models.User.validate_token with a valid 
user id and token (or validate_auth_token, validate_signup_token or any of the 
class methods that call validate_token under the hood).

What is the expected output? What do you see instead?

The class method is documented to return the user entity but instead returns a 
Bool indicating whether the entity was found or not.

What version of the product are you using? On what operating system?

This was discovered using the webapp2 that ships with the latest Google App 
Engine (1.9.21) but is unchanged in HEAD.

Please provide any additional information below.

The problem is the return statement:

return cls.token_model.get(user=user_id, subject=subject, token=token) is not 
None

Simply removing the is not None should make this behave according to docs 
(which is the more useful interface as well).

Original issue reported on code.google.com by k...@strajillion.com on 26 May 2015 at 1:50