From c7aba950159929e4a763fda7be260e7126ad0350 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 27 Sep 2021 17:18:43 +0200 Subject: [PATCH] fixes --- app/scodoc/sco_edit_ue.py | 10 ++++------ app/scodoc/sco_formsemestre.py | 3 --- app/scodoc/sco_inscr_passage.py | 3 +-- app/scodoc/sco_utils.py | 1 + 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index 987a8d1e..a5509a28 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -851,20 +851,18 @@ def ue_sharing_code(ue_code=None, ue_id=None, hide_ue_id=None): ue_code = ue["ue_code"] F = sco_formations.formation_list(args={"formation_id": ue["formation_id"]})[0] formation_code = F["formation_code"] - - if ue_id: - # UE du même code, code formation et departement + # UE du même code, code formation et departement: q_ues = ( NotesUE.query.filter_by(ue_code=ue_code) .join(NotesUE.formation, aliased=True) - .filter_by(dept_id=F["dept_id"], formation_code=formation_code) + .filter_by(dept_id=g.scodoc_dept_id, formation_code=formation_code) ) else: - # Toutes les UE du departement avec ce code + # Toutes les UE du departement avec ce code: q_ues = ( NotesUE.query.filter_by(ue_code=ue_code) .join(NotesUE.formation, aliased=True) - .filter_by(dept_id=F["dept_id"]) + .filter_by(dept_id=g.scodoc_dept_id) ) if hide_ue_id: # enlève l'ue de depart diff --git a/app/scodoc/sco_formsemestre.py b/app/scodoc/sco_formsemestre.py index 9d9c0eef..91e20c29 100644 --- a/app/scodoc/sco_formsemestre.py +++ b/app/scodoc/sco_formsemestre.py @@ -97,9 +97,6 @@ def get_formsemestre(formsemestre_id): "list ONE formsemestre" if not isinstance(formsemestre_id, int): raise ValueError() - raise ScoValueError( - """Semestre invalide, reprenez l'opération au départ ou si le problème persiste signalez l'erreur sur scodoc-devel@listes.univ-paris13.fr""" - ) try: sem = do_formsemestre_list(args={"formsemestre_id": formsemestre_id})[0] return sem diff --git a/app/scodoc/sco_inscr_passage.py b/app/scodoc/sco_inscr_passage.py index 4536be5d..be1f5845 100644 --- a/app/scodoc/sco_inscr_passage.py +++ b/app/scodoc/sco_inscr_passage.py @@ -291,8 +291,7 @@ def formsemestre_inscr_passage( etuds = etuds.split(",") # vient du form de confirmation elif isinstance(etuds, int): etuds = [etuds] - elif isinstance(etuds, list): - etuds = [int(x) for x in etuds] + etuds = [int(x) for x in etuds] auth_etuds_by_sem, inscrits, candidats = list_authorized_etuds_by_sem(sem) etuds_set = set(etuds) candidats_set = set(candidats) diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index dcdd1d9a..dbd353c6 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -53,6 +53,7 @@ from flask import url_for, make_response from config import Config from app import log from app.scodoc.sco_vdi import ApoEtapeVDI +from app.scodoc.sco_xml import quote_xml_attr from app.scodoc.sco_codes_parcours import NOTES_TOLERANCE, CODES_EXPL from app.scodoc import sco_exceptions from app.scodoc import sco_xml