From ead81f7615b98e466e1c0d13794dd07aedcc2865 Mon Sep 17 00:00:00 2001 From: Arthur ZHU Date: Thu, 3 Feb 2022 11:49:16 +0100 Subject: [PATCH] export contacts --- app/entreprises/routes.py | 14 ++++++++++++-- app/templates/entreprises/offres_expirees.html | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/entreprises/routes.py b/app/entreprises/routes.py index 55c4ff4e7..325924572 100644 --- a/app/entreprises/routes.py +++ b/app/entreprises/routes.py @@ -787,7 +787,12 @@ def export_contacts(): """ Permet d'exporter la liste des contacts sous format excel (.xlsx) """ - contacts = EntrepriseContact.query.all() + contacts = ( + db.session.query(EntrepriseContact) + .join(Entreprise, EntrepriseContact.entreprise_id == Entreprise.id) + .filter_by(visible=True) + .all() + ) if contacts: keys = ["nom", "prenom", "telephone", "mail", "poste", "service"] titles = keys[:] @@ -806,7 +811,12 @@ def export_contacts_bis(): """ Permet d'exporter la liste des contacts avec leur entreprise sous format excel (.xlsx) """ - contacts = EntrepriseContact.query.all() + contacts = ( + db.session.query(EntrepriseContact) + .join(Entreprise, EntrepriseContact.entreprise_id == Entreprise.id) + .filter_by(visible=True) + .all() + ) if contacts: keys = [ "nom", diff --git a/app/templates/entreprises/offres_expirees.html b/app/templates/entreprises/offres_expirees.html index 1c94a0937..3a42a7257 100644 --- a/app/templates/entreprises/offres_expirees.html +++ b/app/templates/entreprises/offres_expirees.html @@ -3,7 +3,7 @@ {% block app_content %}
-

Offres expirées de {{ entreprise.nom }}

+

Offres expirées - {{ entreprise.nom }}

{% if offres_expirees %} {% for offre in offres_expirees%} {% include 'entreprises/_offre.html' %}