From 93758b4cf66905b7c58855d75570a9c4ece831fa Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Tue, 30 Apr 2024 19:09:00 +0200 Subject: [PATCH] Update batch command --- .../tenders/management/commands/send_validated_tenders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lemarche/tenders/management/commands/send_validated_tenders.py b/lemarche/tenders/management/commands/send_validated_tenders.py index cb7914909..57feb8ed4 100644 --- a/lemarche/tenders/management/commands/send_validated_tenders.py +++ b/lemarche/tenders/management/commands/send_validated_tenders.py @@ -19,14 +19,14 @@ class Command(BaseCommand): def handle(self, *args, **options): # First send newly validated tenders - validated_tenders_to_send = Tender.objects.validated_but_not_sent() + validated_tenders_to_send = Tender.objects.validated_but_not_sent().is_not_outdated() if validated_tenders_to_send.count(): self.stdout.write(f"Found {validated_tenders_to_send.count()} validated tender(s) to send") for tender in validated_tenders_to_send: send_validated_tender(tender) # Then look at already sent tenders (batch mode) - validated_sent_tenders_batch_to_send = Tender.objects.validated_sent_batch() + validated_sent_tenders_batch_to_send = Tender.objects.validated_sent_batch().is_not_outdated() if validated_sent_tenders_batch_to_send.count(): self.stdout.write( f"Found {validated_sent_tenders_batch_to_send.count()} validated sent tender(s) to batch"