Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 6, 2023
1 parent 6d3d016 commit bcabdbb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lemarche/templates/tenders/_list_item_buyer.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2 class="py-2">{{ tender.title }}</h2>
{% if tender.is_sent %}
<div class="col-md-4">
<i class="ri-time-line"></i>
Publié le {{ tender.validated_at|date }}
Publié le {{ tender.sent_at|date }}
</div>
{% endif %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
6 changes: 3 additions & 3 deletions lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def in_sectors(self, sectors):

def filter_with_siaes(self, siaes):
"""
Return the list of tenders corresponding to the list of Siaes
Return the list of tenders corresponding to the list of
- we return only sent tenders
- the tender-siae matching has already been done with filter_with_tender()
- we return only validated tenders
"""
return self.filter(tendersiae__siae__in=siaes).sent().distinct()
return self.sent().filter(tendersiae__siae__in=siaes).distinct()

def with_deadline_date_is_outdated(self, limit_date=datetime.today()):
return self.annotate(
Expand Down
4 changes: 2 additions & 2 deletions lemarche/www/tenders/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}

Expand Down Expand Up @@ -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(),
}

Expand Down

0 comments on commit bcabdbb

Please sign in to comment.