-
Notifications
You must be signed in to change notification settings - Fork 37
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 31774 use atomic in bo #14083
Pc 31774 use atomic in bo #14083
Conversation
6b1e1c3
to
4c61324
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il faudrait marquer la transaction comme invalid a chaque fois qu'il y a une erreur même si on a pas ecrit dans la db.
@@ -263,7 +267,7 @@ def create_offerer() -> utils.BackofficeResponse: | |||
venue = offerers_api.create_venue(venue_creation_info, current_user) | |||
offerers_api.create_venue_registration(venue.id, new_onboarding_info.target, new_onboarding_info.webPresence) | |||
|
|||
transactional_mails.send_welcome_to_pro_email(pro_user, venue) | |||
on_commit(partial(transactional_mails.send_welcome_to_pro_email, pro_user, venue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans cette fonction on a cette pile d'appel create_venue > get_or_create_address qui contient un rollback
pass-culture-main/api/src/pcapi/core/offerers/api.py:2630
idem pour la fonction get_or_create_offerer_address
pass-culture-main/api/src/pcapi/core/offerers/api.py:2671
e2953a1
to
c0cfcda
Compare
api/src/pcapi/core/offerers/api.py
Outdated
if is_managed_transaction(): | ||
mark_transaction_as_invalid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je crain que ça empeche de créer un offerer si l'adresse existe deja.
Une solution serait re rajouter un context manager atomic autour du try except
api/src/pcapi/core/offerers/api.py
Outdated
if is_managed_transaction(): | ||
mark_transaction_as_invalid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je crain que ça empeche de créer un offerer si l'adresse existe deja.
Une solution serait re rajouter un context manager atomic autour du try except
83907d5
to
05f6907
Compare
05f6907
to
afd1917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm à part les transaction
d5e2347
to
14045b8
Compare
14045b8
to
4ad66d1
Compare
But de la pull request
Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-31774
Vérifications