From 065bcfe1a01e6a03046daad26b62aa21364f33e6 Mon Sep 17 00:00:00 2001 From: Arthur ZHU Date: Wed, 29 Dec 2021 11:10:30 +0100 Subject: [PATCH] correction offres qui ne s'affichaient pas --- app/entreprises/routes.py | 9 ++++++--- app/templates/entreprises/ajout_entreprise.html | 6 ------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/entreprises/routes.py b/app/entreprises/routes.py index db42affe..12309d58 100644 --- a/app/entreprises/routes.py +++ b/app/entreprises/routes.py @@ -75,18 +75,21 @@ def fiche_entreprise(id): offres = entreprise.offres offres_with_files = [] for offre in offres: + files = [] path = os.path.join( - Config.SCODOC_VAR_DIR, "entreprises", f"{entreprise.id}", f"{offre.id}" + Config.SCODOC_VAR_DIR, + "entreprises", + f"{offre.entreprise_id}", + f"{offre.id}", ) if os.path.exists(path): - files = [] for dir in glob.glob( f"{path}/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9]" ): for file in glob.glob(f"{dir}/*"): file = [os.path.basename(dir), os.path.basename(file)] files.append(file) - offres_with_files.append([offre, files]) + offres_with_files.append([offre, files]) contacts = entreprise.contacts logs = ( EntrepriseLog.query.order_by(EntrepriseLog.date.desc()) diff --git a/app/templates/entreprises/ajout_entreprise.html b/app/templates/entreprises/ajout_entreprise.html index 6b0ba311..4a70e83d 100644 --- a/app/templates/entreprises/ajout_entreprise.html +++ b/app/templates/entreprises/ajout_entreprise.html @@ -1,12 +1,6 @@ {% extends 'base.html' %} {% import 'bootstrap/wtf.html' as wtf %} -{% block styles %} -{{super()}} - - -{% endblock %} - {% block app_content %}

{{ title }}