Skip to content

Commit

Permalink
order by super esi
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Dec 28, 2023
1 parent 5b35676 commit 8571584
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lemarche/siaes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ def with_employees_stats(self):
),
)

def order_by_super_siaes(self):
# need to be better specified in the future
return self.order_by("-tender_detail_display_count", "-tender_detail_display_count", "-completion_rate")


class Siae(models.Model):
FIELDS_FROM_C1 = [
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 @@ -59,7 +59,7 @@ def send_tender_emails_to_siaes(tender: Tender):
siae_users_send_count = 0

# queryset
all_siaes = tender.siaes.filter(tendersiae__email_send_date=None)
all_siaes = tender.siaes.filter(tendersiae__email_send_date=None).order_by_super_siaes()
logger.info(f"total siaes {all_siaes.count()}")
siaes = all_siaes[: tender.limit_send_to_siae_batch]

Expand Down

0 comments on commit 8571584

Please sign in to comment.