From 52d0499c9b73cfd4ef0eda4d6f6fe1d0d033000a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 10 May 2022 20:29:30 +0200 Subject: [PATCH] Fix: scodoc_table_results --- app/scodoc/sco_export_results.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/scodoc/sco_export_results.py b/app/scodoc/sco_export_results.py index 30750e3e5..6c0053069 100644 --- a/app/scodoc/sco_export_results.py +++ b/app/scodoc/sco_export_results.py @@ -208,25 +208,29 @@ def _build_results_list(dpv_by_sem, etuds_infos): return rows, titles, columns_ids -def get_set_formsemestre_id_dates(start_date, end_date): +def get_set_formsemestre_id_dates(start_date, end_date) -> set: """Ensemble des formsemestre_id entre ces dates""" s = ndb.SimpleDictFetch( """SELECT id FROM notes_formsemestre - WHERE date_debut >= %(start_date)s AND date_fin <= %(end_date)s + WHERE date_debut >= %(start_date)s + AND date_fin <= %(end_date)s + AND dept_id = %(dept_id)s """, - {"start_date": start_date, "end_date": end_date}, + {"start_date": start_date, "end_date": end_date, "dept_id": g.scodoc_dept_id}, ) return {x["id"] for x in s} -def scodoc_table_results(start_date="", end_date="", types_parcours=[], format="html"): +def scodoc_table_results( + start_date="", end_date="", types_parcours: list = None, format="html" +): """Page affichant la table des résultats Les dates sont en dd/mm/yyyy (datepicker javascript) types_parcours est la liste des types de parcours à afficher (liste de chaines, eg ['100', '210'] ) """ - log("scodoc_table_results: start_date=%s" % (start_date,)) # XXX + log(f"scodoc_table_results: start_date={start_date!r}") if not types_parcours: types_parcours = [] if not isinstance(types_parcours, list):