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

reset UploadFile seek after reading #473

Merged
merged 3 commits into from
Apr 19, 2023
Merged

reset UploadFile seek after reading #473

merged 3 commits into from
Apr 19, 2023

Conversation

murrple-1
Copy link
Contributor

@murrple-1 murrple-1 commented Apr 18, 2023

Fixes #472

@murrple-1 murrple-1 changed the title Fix #472: reset UploadFile seek after reading reset UploadFile seek after reading Apr 18, 2023
@aminalaee
Copy link
Owner

Hey, thanks for taking a look.
I think I already handled this in another step:
https://github.com/aminalaee/sqlalchemy-fields/blob/c7147d2cd61efbfe96fc34d615f54f3dc6087de7/sqlalchemy_fields/storages/filesystem.py#L57

But in your use-case you want to load the upload file before saving, which also shouldn't fail.
Can you please update this test: test_create_form_post
to assert user.file.open().read() == b"abc" to make sure nothing is changed.

@murrple-1
Copy link
Contributor Author

murrple-1 commented Apr 19, 2023

Sorry, I've done my best searching in the repo, and I can't find a test with that name. Which file?

Edit: nvm, found it

Copy link
Owner

@aminalaee aminalaee left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🎉

@aminalaee aminalaee merged commit 682b8fa into aminalaee:main Apr 19, 2023
@aminalaee aminalaee mentioned this pull request Apr 21, 2023
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.

UploadFile has had first byte read
2 participants