-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: Changement de conditions de synchronisation des DDB vers le crm brevo #1622
base: master
Are you sure you want to change the base?
Conversation
proj_resulted_in_reserved_tender = forms.BooleanField( | ||
widget=forms.CheckboxInput(), | ||
required=False, | ||
label=Tender._meta.get_field("proj_resulted_in_reserved_tender").verbose_name, | ||
) | ||
|
||
is_reserved_tender = forms.BooleanField( | ||
widget=forms.CheckboxInput(), | ||
required=False, | ||
label=Tender._meta.get_field("is_reserved_tender").verbose_name, | ||
) | ||
|
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 sort un peu du cadre de la PR mais c'est un petit quick win pour faciliter la saisie pour les bizdev
# Full message expected: duplicate key value violates unique constraint "tenders_tender_slug_0f0b821f_uniq" DETAIL: Key (slug)=(...) already exists. # noqa | ||
if "tenders_tender_slug" in str(e): | ||
self.set_slug(with_uuid=True) | ||
with transaction.atomic(): |
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 ne vois pas à quoi sert la transaction; s'il y a une erreur de contrainte d'intégrité, il n'y aura pas de commit du SQL ?
self.admin = TenderAdmin(Tender, self.admin_site) | ||
|
||
def setUpRequest(self, tender, is_followed_by_us): | ||
tender.is_followed_by_us = is_followed_by_us |
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.
Est ce que c'est utile ? Si j'ai bien compris c'est déjà set par la factory, pourquoi le reset et refaire un save()
?
Normalement tu pourrais définir ta request dans le setup, et l'appeler avec un self.request
, pas besoin des args tender et is_followed_by_us
# Initialize and apply SessionMiddleware | ||
middleware = SessionMiddleware(get_response) | ||
middleware.process_request(request) | ||
request.session.save() # Save the session to avoid any issues |
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.
Ca marche sans, je dirais que le moins c'est le mieux ;)
self.assertIn(".", response.url) | ||
|
||
# Verify the flash messages | ||
messages = request._messages._queued_messages |
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.
Ca marche, mais ce sont des attributs privés, la voie "officielle" c'est celle là j'ai l'impression https://docs.djangoproject.com/en/5.1/ref/contrib/messages/#django.contrib.messages.get_messages
Quoi ?
Changement de conditions de synchronisation des DDB vers le crm brevo. Au lieu de synchroniser par rapport au montant, on synchronise juste si l'attribut
is_followed_by_us=True
Pourquoi ?
Certains cas sont compliqué à jugé sur le prix dans un premier temps.