From 6d905882d6cbf71eef55c255a8c02f5996659fe8 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 17 Jul 2022 17:26:56 +0200 Subject: [PATCH] Fix: erreur si suppression de maquette inexistante --- app/scodoc/sco_etape_apogee_view.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_etape_apogee_view.py b/app/scodoc/sco_etape_apogee_view.py index f0ceecc92..1aa353136 100644 --- a/app/scodoc/sco_etape_apogee_view.py +++ b/app/scodoc/sco_etape_apogee_view.py @@ -658,8 +658,10 @@ def view_apo_csv_delete(etape_apo="", semset_id="", dialog_confirmed=False): info = sco_etape_apogee.apo_csv_get_archive( etape_apo, semset["annee_scolaire"], semset["sem_id"] ) - sco_etape_apogee.apo_csv_delete(info["archive_id"]) - return flask.redirect(dest_url + "&head_message=Archive%20supprimée") + if info: + sco_etape_apogee.apo_csv_delete(info["archive_id"]) + return flask.redirect(dest_url + "&head_message=Archive%20supprimée") + return flask.redirect(dest_url + "&head_message=Archive%20inexistante") def view_apo_csv(etape_apo="", semset_id="", format="html"):