From 3f43f73b080ff754187d02979adb926b3a649a11 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Thu, 23 Nov 2023 12:43:30 +0100 Subject: [PATCH] Replace 30d by 7d --- config/settings/base.py | 4 ++-- .../commands/send_author_transactioned_question_emails.py | 2 +- lemarche/www/tenders/tasks.py | 8 ++++---- lemarche/www/tenders/tests.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 6e161ff68..f20c63494 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -384,8 +384,8 @@ "MAILJET_TENDERS_AUTHOR_INCREMENTAL_2D_TEMPLATE_ID", 4585824 ) MAILJET_TENDERS_AUTHOR_FEEDBACK_30D_TEMPLATE_ID = env.int("MAILJET_TENDERS_AUTHOR_FEEDBACK_30D_TEMPLATE_ID", 4017446) -MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_30D_TEMPLATE_ID = env.int( - "MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_30D_TEMPLATE_ID", 5207181 +MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_7D_TEMPLATE_ID = env.int( + "MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_7D_TEMPLATE_ID", 5207181 ) # 4951625 diff --git a/lemarche/tenders/management/commands/send_author_transactioned_question_emails.py b/lemarche/tenders/management/commands/send_author_transactioned_question_emails.py index 59c875195..40ada6c00 100644 --- a/lemarche/tenders/management/commands/send_author_transactioned_question_emails.py +++ b/lemarche/tenders/management/commands/send_author_transactioned_question_emails.py @@ -55,7 +55,7 @@ def handle(self, kind=None, dry_run=False, is_all_tenders=False, **options): if not dry_run: for tender in tender_qs: - send_tenders_author_feedback_or_survey(tender, kind="transactioned_question") + send_tenders_author_feedback_or_survey(tender, kind="transactioned_question_7d") self.stdout.write(f"Sent {tender_qs.count()} J+30 feedbacks") self.stdout.write("-" * 80) diff --git a/lemarche/www/tenders/tasks.py b/lemarche/www/tenders/tasks.py index 787ef038d..2d51527c6 100644 --- a/lemarche/www/tenders/tasks.py +++ b/lemarche/www/tenders/tasks.py @@ -490,7 +490,7 @@ def send_author_incremental_2_days_email(tender: Tender): tender.save() -def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback"): +def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback_30d"): email_subject = f"Suite à votre {tender.get_kind_display().lower()}" recipient_list = whitelist_recipient_list([tender.author.email]) if recipient_list: @@ -504,8 +504,8 @@ def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback"): "TENDER_KIND": tender.get_kind_display(), } - if kind == "transactioned_question": - template_id = settings.MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_30D_TEMPLATE_ID + if kind == "transactioned_question_7d": + template_id = settings.MAILJET_TENDERS_AUTHOR_TRANSACTIONED_QUESTION_7D_TEMPLATE_ID user_sesame_query_string = sesame_get_query_string(tender.author) # TODO: sesame scope parameter answer_url_with_sesame_token = ( f"https://{get_domain_url()}" @@ -529,7 +529,7 @@ def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback"): # log email log_item = { - "action": f"email_{kind}_30d_sent", + "action": f"email_{kind}_sent", "email_to": recipient_email, "email_subject": email_subject, # "email_body": email_body, diff --git a/lemarche/www/tenders/tests.py b/lemarche/www/tenders/tests.py index cbfa6d5bd..edd9d0694 100644 --- a/lemarche/www/tenders/tests.py +++ b/lemarche/www/tenders/tests.py @@ -1173,7 +1173,7 @@ def test_user_can_notify_cocontracting_wish(self): # def test_send_email_for_feedbacks_set_log(self): # self.assertEqual(len(self.tender.logs), 0) -# send_tenders_author_feedback_or_survey(self.tender, kind="feedback") +# send_tenders_author_feedback_or_survey(self.tender, kind="feedback_30d") # # fetch tender to be sure to have the last version of tender # tender: Tender = Tender.objects.get(pk=self.tender.pk) # self.assertEqual(len(tender.logs), 1)