fix creation exception handling and body serialize#21
Conversation
dsmurrell
left a comment
There was a problem hiding this comment.
Thank you!
It looks like the same setup is required for the patch endpoint. I've just tested with the same output error. If I make the name field unique on User, then try to update one user to have the same name as another user, on the next database transaction I get the same PendingRollbackError: This Session's transaction has been rolled back due to a previous exception during flush. error.
| self.session.commit() | ||
| return obj | ||
| try: | ||
| self.session.commit() |
There was a problem hiding this comment.
Is it possible that someone could use def update_one(self, id_: int, **kwargs) -> object: and set some unique field to a value that already exists in another row which would throw up the same issue?
There was a problem hiding this comment.
indeed, I need to fix the update_one method as well :)
No description provided.