forked from ScoDoc/ScoDoc
Fix 2 errors in assiduites: err. check during excel import
This commit is contained in:
parent
345920e6c5
commit
901367e496
@ -68,7 +68,7 @@ from app.models import (
|
||||
Scolog,
|
||||
)
|
||||
from app.scodoc.codes_cursus import UE_STANDARD
|
||||
|
||||
from app.scodoc import safehtml
|
||||
from app.auth.models import User
|
||||
from app.models.assiduites import get_assiduites_justif, is_period_conflicting
|
||||
from app.tables.list_etuds import RowEtud, TableEtud
|
||||
@ -79,7 +79,6 @@ from app.views import ScoData
|
||||
|
||||
# ---------------
|
||||
from app.scodoc.sco_permissions import Permission
|
||||
from app.scodoc import html_sco_header
|
||||
from app.scodoc import sco_moduleimpl
|
||||
from app.scodoc import sco_preferences
|
||||
from app.scodoc import sco_groups_view, sco_groups
|
||||
@ -2559,6 +2558,8 @@ def _import_excel_assiduites_list(
|
||||
# On parcourt les lignes et on les traite
|
||||
erreurs: list[tuple[str, list]] = []
|
||||
for num, ligne in enumerate(data):
|
||||
if not ligne or len(ligne) < 5:
|
||||
raise ScoValueError("Format de fichier tableau non reconnu")
|
||||
identifiant_etud = ligne[0] # etudid/nip/ine
|
||||
date_debut_str = ligne[1] # iso / fra / excel
|
||||
date_fin_str = ligne[2] # iso / fra / excel
|
||||
@ -2569,7 +2570,10 @@ def _import_excel_assiduites_list(
|
||||
try:
|
||||
# On récupère l'étudiant
|
||||
etud: Identite = _find_etud(identifiant_etud, type_etud_identifiant)
|
||||
|
||||
if not etud:
|
||||
raise ScoValueError(
|
||||
f"Étudiant ({safehtml.html_to_safe_html(identifiant_etud)}) non trouvé"
|
||||
)
|
||||
# On vérifie que l'étudiant appartient au semestre
|
||||
if formsemestre not in etud.get_formsemestres():
|
||||
raise ScoValueError("Étudiant non inscrit dans le semestre")
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
"Infos sur version ScoDoc"
|
||||
|
||||
SCOVERSION = "9.7.44"
|
||||
SCOVERSION = "9.7.45"
|
||||
|
||||
SCONAME = "ScoDoc"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user