+ {% for message in messages %}
+
+ {{message}}
+ {% endfor %} +diff --git a/app/routes.py b/app/routes.py index 90248f5..407c388 100644 --- a/app/routes.py +++ b/app/routes.py @@ -27,6 +27,9 @@ def index(): def Semestre(num): form = SemestreForm() semestre = models.Semestre.query.filter_by(num=num).first() + if semestre == None: + flash("Ce Semestre n'existe pas!", "error") + return redirect(url_for("index")) for i, ue in enumerate(semestre.ues): if form.ueform.__len__() < len(semestre.ues): form.ueform.append_entry(data={"ue": ue.code}) # Donne aux dropdowns la liste des objets de formations que les ACs possèdent sans doublons diff --git a/app/templates/base.html b/app/templates/base.html index 554bbb0..d88b109 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -96,12 +96,27 @@