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

(PC-34142)[API] fix: edit stock: compare dates without tz #16245

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

Conversation

jbaudet-pass
Copy link
Contributor

But de la pull request

Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-34142

Fix rapide concernant la mise à jour des stocks.

Avant
Impossible de détecter que la nouvelle date et l'actuelle sont en fait les mêmes : celle qui vient de la base de données n'a pas d'information de fuseau horaire, le paramètre d'entrée de la fonction l'a.

Après
On retire l'information du fuseau horaire le temps de comparer les deux dates avant de déterminer s'il y a eu un changement à ce niveau-là.

When editing a stock, the existing and the new beginning times were
compared but could never be equal since the first does not have any TZ
information (datetime is saved without it inside the DB) and the later
does.

Now, to find out if the beginning date needs to be updated, the check is
performed with two TZ-unaware datetime objects.

Of course, this should not be needed: the real fix is to save the TZ
inside the database.

So please, please, please
Let me, let me, let me
Let me get the timezones that I want
This time
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