Skip to content

Commit

Permalink
remove with_is_new_for_siaes from method queryset to view
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Mar 11, 2024
1 parent cbf27f8 commit 4153584
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,7 @@ def filter_with_siaes(self, siaes):
- the tender-siae matching has already been done with filter_with_tender()
- with annotation to new if it's new for siaes
"""
return (
self.sent()
.filter(tendersiae__is_deleted_by_siae=False, tendersiae__siae__in=siaes)
.distinct()
.with_is_new_for_siaes(siaes)
)
return self.sent().filter(tendersiae__is_deleted_by_siae=False, tendersiae__siae__in=siaes).distinct()

def with_deadline_date_is_outdated(self, limit_date=datetime.today()):
return self.annotate(
Expand Down
2 changes: 1 addition & 1 deletion lemarche/www/tenders/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def get_queryset(self):
siaes = user.siaes.all()
if siaes:
# we get the first siae by default
qs = Tender.objects.filter_with_siaes(siaes)
qs = Tender.objects.filter_with_siaes(siaes).with_is_new_for_siaes(siaes)
else:
qs = Tender.objects.by_user(user).with_siae_stats()
if self.status:
Expand Down

0 comments on commit 4153584

Please sign in to comment.