From 29869e543f526fcb052adc89de33d1c620a9b3f3 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 20 Dec 2022 19:00:01 -0300 Subject: [PATCH] =?UTF-8?q?WIP:=20jury=20BUT=20avec=20redoublements=20(?= =?UTF-8?q?=C3=A0=20compl=C3=A9ter).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/jury_but_view.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app/but/jury_but_view.py b/app/but/jury_but_view.py index 4cd6044f69..f6437ad92f 100644 --- a/app/but/jury_but_view.py +++ b/app/but/jury_but_view.py @@ -75,7 +75,12 @@ def show_etud(deca: DecisionsProposeesAnnee, read_only: bool = True) -> str: formsemestre_1 = deca.formsemestre_impair formsemestre_2 = deca.formsemestre_pair # Ordonne selon les dates des 2 semestres considérés (pour les redoublants à cheval): - if deca.formsemestre_pair.date_debut < deca.formsemestre_impair.date_debut: + reverse_semestre = ( + deca.formsemestre_pair + and deca.formsemestre_impair + and deca.formsemestre_pair.date_debut < deca.formsemestre_impair.date_debut + ) + if reverse_semestre: formsemestre_1, formsemestre_2 = formsemestre_2, formsemestre_1 H.append( f""" @@ -116,18 +121,21 @@ def show_etud(deca: DecisionsProposeesAnnee, read_only: bool = True) -> str: ), ] # Ordonne selon les dates des 2 semestres considérés: - if deca.formsemestre_pair.date_debut < deca.formsemestre_impair.date_debut: + if reverse_semestre: ues_ro[0], ues_ro[1] = ues_ro[1], ues_ro[0] # Colonnes d'UE: for ue, ue_read_only in ues_ro: - H.append( - _gen_but_niveau_ue( - ue, - deca.decisions_ues[ue.id], - disabled=read_only or ue_read_only, - annee_prec=ue_read_only, + if ue: + H.append( + _gen_but_niveau_ue( + ue, + deca.decisions_ues[ue.id], + disabled=read_only or ue_read_only, + annee_prec=ue_read_only, + ) ) - ) + else: + H.append("""
""") # RCUE if dec_rcue is None: