-
-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
When using FileObjects:
file = FileObject(
backend="s3_nonexistent",
filename="test.png",
content=pil_image.tobytes(),
)
image = Image(
height=100,
width=100,
channels=3,
file=file,
)
session.add(image)
session.commit() # <- will not fail even though the s3 bucket did not exist and the file upload failed
The commit will be succesfull, only later on file.get_contents()
will it become clear that the save operation failed. Looking at the code it seems that this is caused by suppressing all exceptions and only doing the checks in the after_commit
listener.
I was wondering what the design choices were behind this and if it is not better to do things in before_commit
and let all exceptions through.
JonathanCroenen
Metadata
Metadata
Assignees
Labels
No labels