debug search

This commit is contained in:
Robin Champenois 2021-08-29 14:00:27 +02:00
parent db1d35fbb6
commit 25f965c750

View file

@ -147,11 +147,11 @@ def cherche(**kwargs):
# Dates
if field_relevant("avant_annee", False):
dte = date(kwargs["avant_annee"] + 1, 1, 1)
dte = date(min(2100, kwargs["avant_annee"]) + 1, 1, 1)
filtres &= Q(date_fin__lt=dte)
if field_relevant("apres_annee", False):
dte = date(kwargs["apres_annee"], 1, 1)
dte = date(max(2000, kwargs["apres_annee"]), 1, 1)
filtres &= Q(date_debut__gte=dte)
# Type de stage
@ -187,6 +187,8 @@ def cherche(**kwargs):
)
else:
resultat = resultat.order_by(tri)
else:
resultat = resultat.order_by(tri)
return resultat, tri