From 9535ff1e911372f8f20a9ac5a7d740f6cf12e422 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 1 Nov 2022 09:26:30 +0100 Subject: [PATCH] Desactive upload referentiels competences en prod. --- app/views/refcomp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/refcomp.py b/app/views/refcomp.py index c3b6e24c..9be3c975 100644 --- a/app/views/refcomp.py +++ b/app/views/refcomp.py @@ -14,8 +14,6 @@ from flask_login import current_user from werkzeug.utils import redirect from werkzeug.utils import secure_filename -from config import Config - from app import db from app import log @@ -218,6 +216,9 @@ def refcomp_load(formation_id=None): log(f"refcomp_load: ignoring {filename} (already loaded)") form = RefCompLoadForm() + if current_app and not current_app.config["DEBUG"]: + form.upload.render_kw = {"disabled": "disabled"} + form.referentiel_standard.choices = [ (r["id"], f"{r['specialite']} ({r['created']}-{r['serial']})") for r in refs_distrib_dict