diff --git a/lemarche/templates/tenders/_list_item_buyer.html b/lemarche/templates/tenders/_list_item_buyer.html
index 2ea06d275..9887e8407 100644
--- a/lemarche/templates/tenders/_list_item_buyer.html
+++ b/lemarche/templates/tenders/_list_item_buyer.html
@@ -36,7 +36,7 @@
{{ tender.title }}
{% if tender.is_sent %}
- PubliƩ le {{ tender.validated_at|date }}
+ PubliƩ le {{ tender.sent_at|date }}
{% endif %}
diff --git a/lemarche/tenders/management/commands/send_author_incremental_emails.py b/lemarche/tenders/management/commands/send_author_incremental_emails.py
index c43fde580..585e0df1b 100644
--- a/lemarche/tenders/management/commands/send_author_incremental_emails.py
+++ b/lemarche/tenders/management/commands/send_author_incremental_emails.py
@@ -29,8 +29,8 @@ def handle(self, dry_run=False, **options):
two_days_ago = timezone.now() - timedelta(days=2)
three_days_ago = timezone.now() - timedelta(days=3)
tender_sent_incremental = Tender.objects.sent().is_incremental()
- tender_sent_incremental_2_days = tender_sent_incremental.filter(created_at__gte=three_days_ago).filter(
- created_at__lt=two_days_ago
+ tender_sent_incremental_2_days = tender_sent_incremental.filter(sent_at__gte=three_days_ago).filter(
+ sent_at__lt=two_days_ago
)
self.stdout.write(f"Found {tender_sent_incremental_2_days.count()} Tenders")
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 66eb1516e..780cbfa16 100644
--- a/lemarche/tenders/management/commands/send_author_transactioned_question_emails.py
+++ b/lemarche/tenders/management/commands/send_author_transactioned_question_emails.py
@@ -35,8 +35,10 @@ def handle(self, kind=None, dry_run=False, is_all_tenders=False, **options):
self.stdout.write("-" * 80)
start_date_feature = datetime(2022, 6, 23).date()
# we first filter on validated tenders
- tender_qs = Tender.objects.transaction_survey_email(kind=kind, all=is_all_tenders).filter(
- deadline_date__gte=start_date_feature
+ tender_qs = (
+ Tender.objects.sent()
+ .transaction_survey_email(kind=kind, all=is_all_tenders)
+ .filter(deadline_date__gte=start_date_feature)
)
self.stdout.write(f"Found {tender_qs.count()} tenders")
diff --git a/lemarche/tenders/migrations/0063_tender_status_sent.py b/lemarche/tenders/migrations/0064_tender_status_sent.py
similarity index 94%
rename from lemarche/tenders/migrations/0063_tender_status_sent.py
rename to lemarche/tenders/migrations/0064_tender_status_sent.py
index 3d14a8022..5a5d1af41 100644
--- a/lemarche/tenders/migrations/0063_tender_status_sent.py
+++ b/lemarche/tenders/migrations/0064_tender_status_sent.py
@@ -14,7 +14,7 @@ def populate_tenders_sent_status(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [
- ("tenders", "0062_tender_rename_kind_quote_display"),
+ ("tenders", "0063_tender_distance_location"),
]
operations = [
diff --git a/lemarche/www/tenders/tasks.py b/lemarche/www/tenders/tasks.py
index 2d51527c6..3748dd473 100644
--- a/lemarche/www/tenders/tasks.py
+++ b/lemarche/www/tenders/tasks.py
@@ -466,7 +466,7 @@ def send_author_incremental_2_days_email(tender: Tender):
variables = {
"TENDER_AUTHOR_FIRST_NAME": tender.author.first_name,
"TENDER_TITLE": tender.title,
- "TENDER_VALIDATE_AT": tender.validated_at.strftime("%d %B %Y"),
+ "TENDER_VALIDATE_AT": tender.sent_at.strftime("%d %B %Y"), # TODO: TENDER_SENT_AT?
"TENDER_KIND": tender.get_kind_display(),
}
@@ -500,7 +500,7 @@ def send_tenders_author_feedback_or_survey(tender: Tender, kind="feedback_30d"):
variables = {
"TENDER_AUTHOR_FIRST_NAME": tender.author.first_name,
"TENDER_TITLE": tender.title,
- "TENDER_VALIDATE_AT": tender.validated_at.strftime("%d %B %Y"),
+ "TENDER_VALIDATE_AT": tender.sent_at.strftime("%d %B %Y"), # TODO: TENDER_SENT_AT?
"TENDER_KIND": tender.get_kind_display(),
}