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

auth: Rollback Unique DS entries if user.put() fails #82

Open
GoogleCodeExporter opened this issue May 5, 2015 · 0 comments
Open

auth: Rollback Unique DS entries if user.put() fails #82

GoogleCodeExporter opened this issue May 5, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a user model that will fail when put() is called on it. E.g.:

class CustomUser(webapp2_extras.appengine.auth.models.User):
  has_error = ndb.StringProperty(default=False)

2. call 

ok, user = CustomUser.create_user('some_fake_auth_id')

3. the line "user.put()" in create_user 
http://webapp-improved.appspot.com/_modules/webapp2_extras/appengine/auth/models
.html#User.create_user
will fail. 

4. The Unique datastore will hold an entry for CustomUser with 
'some_fake_auth_id', but CustomUser will be empty, because user creation failed.



What version of the product are you using? On what operating system?
App Engine / Python
- name: webapp2
  version: "2.5.1"



Please provide any additional information below.
Though this example the error is clearly on the programmer's side in providing 
a model that won't allow for it to be saved, there are other sources of errors 
(DeadLineExceededError e.g.) that will cause user.put() to fail. I think in 
that case, webapp2 should handle this scenario gracefully and rollback the 
changes it made to the Unique datastore.



Original issue reported on code.google.com by [email protected] on 18 Jul 2013 at 6:28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant