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

Refresh SQLAlchemy object after creation in POST #647

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jfinkels
Copy link
Owner

Partially fixes issue #630.

What change does this make? This adds Sesson.refresh(obj) call to the SQLAlchemy object created during a POST request. Calling refresh() after the object has been added and the session flushed causes any timezone-aware datetime attribute deserialized from the incoming request to be re-read from the database as timezone-naive datetime if the database is configured that way.

How does this affect the user? This corrects a bug in which the response to a POST request incorrectly still showed the timezone-aware datetime attribute even though the database was storing only the timezone-naive datetime attribute.

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.

1 participant