diff --git a/app/scodoc/sco_exceptions.py b/app/scodoc/sco_exceptions.py index d975766e..dd872a7a 100644 --- a/app/scodoc/sco_exceptions.py +++ b/app/scodoc/sco_exceptions.py @@ -36,11 +36,6 @@ class ScoException(Exception): pass -class NoteProcessError(ScoException): - "misc errors in process" - pass - - class InvalidEtudId(NoteProcessError): pass @@ -56,6 +51,11 @@ class ScoValueError(ScoException): self.dest_url = dest_url +class NoteProcessError(ScoValueError): + "Valeurs notes invalides" + pass + + class ScoFormatError(ScoValueError): pass diff --git a/app/scodoc/sco_saisie_notes.py b/app/scodoc/sco_saisie_notes.py index 0fa105db..d0a5407d 100644 --- a/app/scodoc/sco_saisie_notes.py +++ b/app/scodoc/sco_saisie_notes.py @@ -487,10 +487,10 @@ def notes_add( } for (etudid, value) in notes: if check_inscription and (etudid not in inscrits): - raise NoteProcessError("etudiant non inscrit dans ce module") - if not ((value is None) or (type(value) == type(1.0))): + raise NoteProcessError(f"etudiant {etudid} non inscrit dans ce module") + if (value is not None) and not isinstance(value, float): raise NoteProcessError( - "etudiant %s: valeur de note invalide (%s)" % (etudid, value) + f"etudiant {etudid}: valeur de note invalide ({value})" ) # Recherche notes existantes notes_db = sco_evaluation_db.do_evaluation_get_all_notes(evaluation_id) diff --git a/sco_version.py b/sco_version.py index cab845d1..23676c26 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.25" +SCOVERSION = "9.1.26" SCONAME = "ScoDoc"