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

[Dépôt de besoin] Envoyer en asynchrone les besoins validés #998

Merged
merged 4 commits into from
Dec 6, 2023

Conversation

raphodn
Copy link
Contributor

@raphodn raphodn commented Nov 30, 2023

Suite de #997

Quoi ?

Les besoins validés via l'admin ne sont plus envoyés automatiquement.
C'est cette nouvelle management commande send_validated_tenders qui sera chargée de le faire.

Ajout dans le cron avec */5 9-17 * * 1-5 = Every 5 minutes from 9am through 5pm on Monday through Friday
https://cron.help/#*/5_9-17_*_*_1-5

@raphodn raphodn self-assigned this Nov 30, 2023
@raphodn raphodn force-pushed the raphodn/tender-status-sent branch 3 times, most recently from f68c1df to 009ca22 Compare December 1, 2023 10:10
@raphodn raphodn force-pushed the raphodn/tender-send-with-cron branch from 084501a to 6be2f87 Compare December 1, 2023 10:44
@raphodn raphodn marked this pull request as ready for review December 1, 2023 10:51
Copy link
Contributor

@SebastienReuiller SebastienReuiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

if settings.BITOUBI_ENV == "prod":
api_hubspot.create_deal_from_tender(tender=obj)
obj.set_validated()
self.message_user(request, "Ce dépôt de besoin a été validé. Il sera envoyé en temps voulu :)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

# Send Tenders who are validated but not sent

# Do not run if this env var is not set:
if [[ -z "$CRON_TENDER_SEND_VALIDATED_ENABLED" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'adore cette possibilité de débrayer !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seul hic, c'est qu'il n'y a pas d'option intermédiaire (désactiver le cron mais permettre l'envoi manuel 🤔 )

@raphodn raphodn force-pushed the raphodn/tender-status-sent branch 3 times, most recently from 4dd020e to bcabdbb Compare December 6, 2023 12:28
Base automatically changed from raphodn/tender-status-sent to master December 6, 2023 12:32
@raphodn raphodn force-pushed the raphodn/tender-send-with-cron branch from f73a3fd to 0c196af Compare December 6, 2023 12:33
@raphodn raphodn merged commit f766596 into master Dec 6, 2023
4 checks passed
@raphodn raphodn deleted the raphodn/tender-send-with-cron branch December 6, 2023 13:46
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.

2 participants