diff --git a/app/scodoc/sco_saisie_notes.py b/app/scodoc/sco_saisie_notes.py index e5d7f3da..889d5fb0 100644 --- a/app/scodoc/sco_saisie_notes.py +++ b/app/scodoc/sco_saisie_notes.py @@ -583,12 +583,8 @@ def notes_add( existing_note = NotesNotes.query.filter_by( evaluation_id=evaluation_id, etudid=etudid ).first() - sco_cache.EvaluationCache.delete(evaluation_id) - notes_db = sco_evaluation_db.do_evaluation_get_all_notes( - evaluation_id - ) raise ScoBugCatcher( - f"dup: existing={existing_note} etudid={repr(etudid)} value={value} in_db={etudid in notes_db}" + f"dup: existing={existing_note}" ) from exc changed = True else: @@ -885,12 +881,20 @@ def feuille_saisie_notes(evaluation_id, group_ids=[]): indication_date = evaluation.jour.isoformat() else: indication_date = scu.sanitize_filename(evaluation.description or "")[:12] - eval_name = f"{evaluation.moduleimpl.module.code}-{indication_date}" + eval_name = "%s-%s" % (evaluation.moduleimpl.module.code, indication_date) - date_str = ( - f"""du {evaluation.jour.strftime("%d/%m/%Y")}""" - if evaluation.jour - else "(sans date)" + if evaluation.description: + evaltitre = "%s du %s" % ( + evaluation.description, + evaluation.jour.strftime("%d/%m/%Y"), + ) + else: + evaltitre = "évaluation du %s" % evaluation.jour.strftime("%d/%m/%Y") + description = "%s en %s (%s) resp. %s" % ( + evaltitre, + evaluation.moduleimpl.module.abbrev or "", + evaluation.moduleimpl.module.code, + mod_responsable["prenomnom"], ) eval_titre = f"""{evaluation.description if evaluation.description else "évaluation"} {date_str}""" @@ -941,7 +945,7 @@ def feuille_saisie_notes(evaluation_id, group_ids=[]): filename = f"notes_{eval_name}_{gr_title_filename}" xls = sco_excel.excel_feuille_saisie( - evaluation, formsemestre.titre_annee(), description, lines=rows + evaluation, formsemestre.titre_annee(), description, lines=L ) return scu.send_file(xls, filename, scu.XLSX_SUFFIX, mime=scu.XLSX_MIMETYPE)