Skip to content

Commit

Permalink
Additional fixes (filter on tender without transaction info)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Feb 22, 2024
1 parent ab9c97e commit 33ad397
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class Command(BaseCommand):
"""
Daily script to send an email to tender siaes
Rules
- Tender must be "sent"
- Siae must be "interested"
- Siae must not have received a survey yet
- Tender must be "sent" + no info on "transactioned"
When?
- J+7 after tender start_working_date
Expand All @@ -31,8 +29,9 @@ def add_arguments(self, parser):
def handle(self, kind=None, reminder=False, dry_run=False, **options):
self.stdout.write("Script to send email tender transactioned_question to interested siaes...")

# tender must be sent & start_working_date J+7
tender_qs = Tender.objects.sent().filter(start_working_date=seven_days_ago)
# tender must be sent & no info on transaction & start_working_date J+7
tender_qs = Tender.objects.sent().filter(siae_transactioned=None)
tender_qs = tender_qs.filter(start_working_date=seven_days_ago)

self.stdout.write(f"Found {tender_qs.count()} tenders")

Expand Down
2 changes: 1 addition & 1 deletion lemarche/www/tenders/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def send_tenders_siae_survey(tendersiae: TenderSiae, kind="transactioned_questio
# add timestamp
tendersiae.survey_transactioned_send_date = timezone.now()

api_mailjet.send_transactional_email_many_recipient_with_template(
api_mailjet.send_transactional_email_with_template(
template_id=template_id,
subject=email_subject,
recipient_email=recipient_email,
Expand Down

0 comments on commit 33ad397

Please sign in to comment.