Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
2 changed files with 13 additions and 4 deletions
Showing only changes of commit 5fc1800f70 - Show all commits

View File

@ -56,6 +56,10 @@ class ParametrageClasseurPE(FlaskForm):
# synthese_individuelle_etud = BooleanField(
# "Générer (suppose les RCUES)"
# )
publipostage = BooleanField(
"Nomme les moyennes pour publipostage",
# default=False,
# render_kw={"checked": ""},
)
submit = SubmitField("Générer les classeurs poursuites d'études")
cancel = SubmitField("Annuler", render_kw={"formnovalidate": True})

View File

@ -560,7 +560,11 @@ class JuryPE(object):
for onglet, df in self.synthese.items():
# Conversion colonnes en multiindex
df_final = df.copy()
df_final = convert_colonnes_to_multiindex(df_final)
if (
"publipostage" not in self.options
or not self.options["publipostage"]
):
df_final = convert_colonnes_to_multiindex(df_final)
# Nom de l'onglet
if isinstance(onglet, tuple):
(repr, type_moy) = onglet
@ -824,6 +828,7 @@ def get_formsemestres_etudiants(etudiants: pe_etudiant.EtudiantsJuryPE) -> dict:
def convert_colonnes_to_multiindex(df):
"""Convertit les colonnes d'un df pour obtenir des colonnes
multiindex"""
df_final = df.copy()
colonnes = list(df.columns)
colonnes = [tuple(col.split("|")) for col in colonnes]
# modifie le nom du semestre par sa descr
@ -838,5 +843,5 @@ def convert_colonnes_to_multiindex(df):
col_verbose = col
colonnes_verbose.append(col_verbose)
df.columns = pd.MultiIndex.from_tuples(colonnes_verbose)
return df
df_final.columns = pd.MultiIndex.from_tuples(colonnes_verbose)
return df_final