correction offres qui ne s'affichaient pas

This commit is contained in:
Arthur ZHU 2021-12-29 11:10:30 +01:00
parent 41b50e0c1c
commit 065bcfe1a0
2 changed files with 6 additions and 9 deletions

View File

@ -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())

View File

@ -1,12 +1,6 @@
{% extends 'base.html' %}
{% import 'bootstrap/wtf.html' as wtf %}
{% block styles %}
{{super()}}
<link type="text/css" rel="stylesheet" href="/ScoDoc/static/css/autosuggest_inquisitor.css" />
<script src="/ScoDoc/static/libjs/AutoSuggest.js"></script>
{% endblock %}
{% block app_content %}
<h1>{{ title }}</h1>
<br>