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

Handle integrity error on delete #115

Merged

Conversation

Alain1405
Copy link
Contributor

-Fix SqlAlchemy manager not taking care of handling Integrity Error on delete. (rollback the session and return a nice message to the client)

  • The debug message returned to the client doesn't include the exception message. This is fixed.

@coveralls
Copy link

coveralls commented Feb 2, 2017

Coverage Status

Coverage decreased (-0.2%) to 88.881% when pulling 5061cca on Alain1405:handle-integrity_error-on-delete into d106bd0 on biosustain:master.

if current_app.debug:
raise BackendConflict(debug_info=dict(exception_message=str(e), statement=e.statement, params=e.params))
raise BackendConflict()

session = self._get_session()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are going through the deletion twice here. Otherwise it looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, I'm usually very good at copy pasting! ;)

@coveralls
Copy link

coveralls commented Feb 2, 2017

Coverage Status

Coverage decreased (-0.2%) to 88.868% when pulling e74bae4 on Alain1405:handle-integrity_error-on-delete into d106bd0 on biosustain:master.

@lyschoening lyschoening merged commit dda07fa into biosustain:master Feb 2, 2017
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

Successfully merging this pull request may close these issues.

3 participants