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

PATCH doesn't rollback the session #356

Closed
tonnydourado opened this issue Sep 3, 2014 · 2 comments
Closed

PATCH doesn't rollback the session #356

tonnydourado opened this issue Sep 3, 2014 · 2 comments
Labels

Comments

@tonnydourado
Copy link

@tonnydourado tonnydourado commented Sep 3, 2014

When a PATCH request goes wrong, raising an SQLAlchemy exception like IntegrityError, session.rollback() should be called, like in the method that handles POST requests. More specifically, this except should call self.session.rollback like this.

A workaround I found is passing the sqlalchemy exception to the validation_exceptions argument, but it yields an ugly Could not determine specific validation errors message.

@andir
Copy link
Contributor

@andir andir commented Sep 3, 2014

I've added a test & fix for that at: https://github.com/andir/flask-restless/tree/patch_rollback

Test & Fix @ andir@0ad508f

Is that what you had in mind? If so I'll open a PR.

Loading

@tonnydourado
Copy link
Author

@tonnydourado tonnydourado commented Sep 4, 2014

Yep, that's exactly what I meant =)

Loading

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

Successfully merging a pull request may close this issue.

None yet
3 participants