diff --git a/app/models/etudiants.py b/app/models/etudiants.py index 0f81ad6bf..2dab949c4 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -108,10 +108,13 @@ class Identite(db.Model): return r[0] if r else None def inscription_courante_date(self, date_debut, date_fin): + """La première inscription à un formsemestre incluant la + période [date_debut, date_fin] + """ r = [ ins for ins in self.formsemestre_inscriptions - if ins.formsemestre.est_courant_date(date_debut, date_fin) + if ins.formsemestre.contient_periode(date_debut, date_fin) ] return r[0] if r else None diff --git a/app/models/formsemestre.py b/app/models/formsemestre.py index dc13c1cc8..28be41559 100644 --- a/app/models/formsemestre.py +++ b/app/models/formsemestre.py @@ -146,8 +146,9 @@ class FormSemestre(db.Model): today = datetime.date.today() return (self.date_debut <= today) and (today <= self.date_fin) - def est_courant_date(self, date_debut, date_fin) -> bool: - """Vrai si la date actuelle (now) est dans le semestre + def contient_periode(self, date_debut, date_fin) -> bool: + """Vrai si l'intervalle [date_debut, date_fin] est + inclus dans le semestre. (les dates de début et fin sont incluses) """ return (self.date_debut <= date_debut) and (date_fin <= self.date_fin) diff --git a/app/templates/entreprises/_contact.html b/app/templates/entreprises/_contact.html index eff3a8cb2..0eb8ebfee 100644 --- a/app/templates/entreprises/_contact.html +++ b/app/templates/entreprises/_contact.html @@ -1,3 +1,4 @@ +{# -*- mode: jinja-html -*- #}
Nom : {{ contact.nom }}
diff --git a/app/templates/entreprises/_offre.html b/app/templates/entreprises/_offre.html
index fd21211d2..ea69110e9 100644
--- a/app/templates/entreprises/_offre.html
+++ b/app/templates/entreprises/_offre.html
@@ -1,3 +1,4 @@
+{# -*- mode: jinja-html -*- #}
Intitulé : {{ offre[0].intitule }}
diff --git a/app/templates/entreprises/ajout_entreprise.html b/app/templates/entreprises/ajout_entreprise.html
index 4a70e83d5..15cf174fb 100644
--- a/app/templates/entreprises/ajout_entreprise.html
+++ b/app/templates/entreprises/ajout_entreprise.html
@@ -1,3 +1,4 @@
+{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% import 'bootstrap/wtf.html' as wtf %}
diff --git a/app/templates/entreprises/ajout_historique.html b/app/templates/entreprises/ajout_historique.html
index f4da2661b..c0a546d59 100644
--- a/app/templates/entreprises/ajout_historique.html
+++ b/app/templates/entreprises/ajout_historique.html
@@ -1,3 +1,4 @@
+{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% import 'bootstrap/wtf.html' as wtf %}
diff --git a/app/templates/entreprises/contacts.html b/app/templates/entreprises/contacts.html
index 87112710f..54d77bd55 100644
--- a/app/templates/entreprises/contacts.html
+++ b/app/templates/entreprises/contacts.html
@@ -1,3 +1,4 @@
+{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% block app_content %}
diff --git a/app/templates/entreprises/delete_confirmation.html b/app/templates/entreprises/delete_confirmation.html
index 06b75b6ad..4894bca3e 100644
--- a/app/templates/entreprises/delete_confirmation.html
+++ b/app/templates/entreprises/delete_confirmation.html
@@ -1,3 +1,4 @@
+{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% import 'bootstrap/wtf.html' as wtf %}
diff --git a/app/templates/entreprises/entreprises.html b/app/templates/entreprises/entreprises.html
index 9cbe2330f..fe790a8d6 100644
--- a/app/templates/entreprises/entreprises.html
+++ b/app/templates/entreprises/entreprises.html
@@ -1,3 +1,4 @@
+{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% block app_content %}
diff --git a/app/templates/entreprises/envoi_offre_form.html b/app/templates/entreprises/envoi_offre_form.html
index c9db2c6c1..f67cb4e40 100644
--- a/app/templates/entreprises/envoi_offre_form.html
+++ b/app/templates/entreprises/envoi_offre_form.html
@@ -1,3 +1,4 @@
+{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% import 'bootstrap/wtf.html' as wtf %}
diff --git a/app/templates/entreprises/fiche_entreprise.html b/app/templates/entreprises/fiche_entreprise.html
index f3cc68269..d34531207 100644
--- a/app/templates/entreprises/fiche_entreprise.html
+++ b/app/templates/entreprises/fiche_entreprise.html
@@ -1,72 +1,76 @@
+{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% block app_content %}
- {% if logs %}
-
- SIRET : {{ entreprise.siret }}
- Nom : {{ entreprise.nom }}
- Adresse : {{ entreprise.adresse }}
- Code postal : {{ entreprise.codepostal }}
- Ville : {{ entreprise.ville }}
- Pays : {{ entreprise.pays }}
-
+ SIRET : {{ entreprise.siret }}
+ Nom : {{ entreprise.nom }}
+ Adresse : {{ entreprise.adresse }}
+ Code postal : {{ entreprise.codepostal }}
+ Ville : {{ entreprise.ville }}
+ Pays : {{ entreprise.pays }}
+