From 73cf9a6f4d42b2261d1b0a7452f81d42860c346d Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 24 Sep 2021 00:04:28 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20evaluations=20=C3=A0=20dates=20vides=20(?= =?UTF-8?q?tri)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/bonus_sport.py | 4 ++-- app/scodoc/sco_evaluations.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/scodoc/bonus_sport.py b/app/scodoc/bonus_sport.py index 4a3a83e61..23cea0566 100644 --- a/app/scodoc/bonus_sport.py +++ b/app/scodoc/bonus_sport.py @@ -386,8 +386,8 @@ def bonus_demo(notes_sport, coefs, infos=None): qui est ECRASE à chaque appel. *** Ne pas utiliser en production !!! *** """ - f = open("/tmp/scodoc_bonus.log", "w") # mettre 'a' pour ajouter en fin - f.write("\n---------------\n" + pprint.pformat(infos) + "\n") + with open("/tmp/scodoc_bonus.log", "w") as f: # mettre 'a' pour ajouter en fin + f.write("\n---------------\n" + pprint.pformat(infos) + "\n") # Statut de chaque UE # for ue_id in infos['moy_ues']: # ue_status = infos['moy_ues'][ue_id] diff --git a/app/scodoc/sco_evaluations.py b/app/scodoc/sco_evaluations.py index 16cb1bbf2..550194809 100644 --- a/app/scodoc/sco_evaluations.py +++ b/app/scodoc/sco_evaluations.py @@ -274,13 +274,13 @@ def do_evaluation_create( if args["jour"]: next_eval = None t = ( - ndb.DateDMYtoISO(args["jour"]), - ndb.TimetoISO8601(args["heure_debut"]), + ndb.DateDMYtoISO(args["jour"], null_is_empty=True), + ndb.TimetoISO8601(args["heure_debut"], null_is_empty=True), ) for e in ModEvals: if ( - ndb.DateDMYtoISO(e["jour"]), - ndb.TimetoISO8601(e["heure_debut"]), + ndb.DateDMYtoISO(e["jour"], null_is_empty=True), + ndb.TimetoISO8601(e["heure_debut"], null_is_empty=True), ) > t: next_eval = e break