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-33722)[API] fix: rm current_user as a parameter inside public route #15665

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-33722

Bug : impossible d'annuler le stock d'un événement via l'API publique si celui-ci a au moins une réservation.

Fix : ne pas utiliser current_user dans l'API publique puisqu'il renvoie un objet représentant un utilisateur anonyme (logique, puisqu'elle n'utilise pas flask login) ce qui créé quelques étincelles au moment de mettre à jour la réservation ("cancellationUserId doit être un entier").

Bug: could not cancel an event's stock from the public API if it had at
least one booking. The cancellationUserId was an invalid flask login's
anonymous user object that was used because the controller called flask
login's current_user proxy... which does not make sense since the public
API does not rely on flask login.

Fix: do not use current_user proxy. User the default value instead
(None).
Copy link
Contributor

Visit the preview URL for this PR (updated for commit e92443f):

https://pc-pro-testing--pr15665-pc-33722-fix-public-2my3wkzz.web.app

(expires Sun, 29 Dec 2024 11:24:27 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 032d233ee67e1c50d6af12e29c936c7076770eb1

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