-
Notifications
You must be signed in to change notification settings - Fork 38
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-29597)[API] chore : read duration minutes from produts #14596
base: master
Are you sure you want to change the base?
Conversation
060ff8c
to
2df764d
Compare
@@ -55,8 +55,7 @@ def synchronize(self) -> None: | |||
|
|||
product = self.get_or_create_movie_product(event) | |||
offer = self.get_or_create_offer(event, self.provider.id, self.venue) | |||
offer.product = product |
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.
On veut garder cette ligne non ?
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 l'ai décalée plus bas dans le fill_offer_attribute
. Si je la laisse ici j'ai un auto_flush si je fait un if offer.product:
sqlalchemy flush l'offre et j'ai une erreur.
Dans le if product:
j'ai mis le offer.product = product
@durationMinutes.setter | ||
def durationMinutes(self, value: int | None) -> None: | ||
if self.product: | ||
self._durationMinutes = None |
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.
On veut pas un warning ou autre pour dire que la fonction n'a pas l'effet escompté ? Voire une exception
@durationMinutes.setter | ||
def durationMinutes(self, value: int | None) -> None: | ||
if self.product: | ||
self._durationMinutes = None |
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 n'y a pas de risque que le pro remplisse le champ et ne voit pas la modification attendue ?
Est-ce que l'on ne devrait pas lever une erreur explicite ?
@@ -17,7 +17,7 @@ def test_should_return_error_when_information_requires_a_string_type(): | |||
def test_should_return_error_when_information_requires_an_integer_type(): | |||
offer = offers_factories.OfferFactory.build(durationMinutes="not a number") | |||
api_error = validate_generic(offer) | |||
assert api_error.errors == {"durationMinutes": ["doit être un entier"]} |
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 n'y a pas d'incompatibilité avec le front ? c'est dommage d'envoyer un champ et d'avoir une erreur sur un autre
if offer.product.extraData: | ||
if product: | ||
offer.name = product.name | ||
offer.description = product.description |
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.
A supprimer
It should have boen done here : https://github.com/pass-culture/pass-culture-main/pull/14209/files
18799d8
to
0486699
Compare
But de la pull request
Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-29597
Vérifications