From 4526a6b93408cb0a992f717b61e4e486237afa78 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 4 Jul 2021 12:42:04 +0200 Subject: [PATCH] fix route conflict --- app/__init__.py | 2 +- app/main/routes.py | 4 ++-- app/templates/main/index.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 848d5146d..4e0cbb048 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -42,7 +42,7 @@ moment = Moment() @app.before_request def open_dept_db_connection(): # current_app.logger.info("open_dept_db_connection") - if hasattr(g, "scodoc_dept") and not hasattr(g, "db_conn"): + if hasattr(g, "scodoc_dept") and not hasattr(g, "db_conn") and g.scodoc_dept: g.db_conn = ndb.open_dept_connection() diff --git a/app/main/routes.py b/app/main/routes.py index a5cd8af5d..f504a37c1 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -141,9 +141,9 @@ def a_zope_form_post(REQUEST=None): return "\n".join(H) -@bp.route("/ScoDoc//Scolarite/Notes/formsemestre_status") +@bp.route("/ScoDoc//Scolarite/Notes/formsemestre_statux") @scodoc7func(context) -def formsemestre_status(dept_id=None, formsemestre_id=None, REQUEST=None): +def formsemestre_statux(dept_id=None, formsemestre_id=None, REQUEST=None): """Essai méthode de département Le contrôle d'accès doit vérifier les bons rôles : ici Ens """ diff --git a/app/templates/main/index.html b/app/templates/main/index.html index c3724c28e..ac9bcebf9 100644 --- a/app/templates/main/index.html +++ b/app/templates/main/index.html @@ -28,7 +28,7 @@ non protégé renvoyant vers une page protégée -
  • formsemestre_status : a-t-on +
  • formsemestre_statux : a-t-on le rôle EnsRT ?
  • Notes/essai : test "notes", url