From 5c9126d26367a23b95889e9c4a48ff4349fc4cae Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 27 Feb 2024 21:23:45 +0100 Subject: [PATCH] Merge PE v4 --- app/api/departements.py | 4 ++-- config.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/api/departements.py b/app/api/departements.py index b82966e3..7d056e46 100644 --- a/app/api/departements.py +++ b/app/api/departements.py @@ -187,7 +187,7 @@ def dept_etudiants(acronym: str): ] """ dept = Departement.query.filter_by(acronym=acronym).first_or_404() - return [etud.to_dict_short() for etud in dept.etats_civils] + return [etud.to_dict_short() for etud in dept.etudiants] @bp.route("/departement/id//etudiants") @@ -200,7 +200,7 @@ def dept_etudiants_by_id(dept_id: int): Retourne la liste des étudiants d'un département d'id donné. """ dept = Departement.query.get_or_404(dept_id) - return [etud.to_dict_short() for etud in dept.etats_civils] + return [etud.to_dict_short() for etud in dept.etudiants] @bp.route("/departement//formsemestres_ids") diff --git a/config.py b/config.py index eefebdfc..d98e9513 100755 --- a/config.py +++ b/config.py @@ -61,11 +61,11 @@ class DevConfig(Config): DEBUG = True TESTING = False SQLALCHEMY_DATABASE_URI = ( - os.environ.get("SCODOC_DATABASE_URI") or "postgresql:///SCODOC" + os.environ.get("SCODOC_DATABASE_URI") or "postgresql:///SCODOC_DEV" ) SECRET_KEY = os.environ.get("DEV_SECRET_KEY") or "bb3faec7d9a34eb68a8e3e710087d87a" # pour le avoir url_for dans le shell: - SERVER_NAME = "http://localhost:8080" + # SERVER_NAME = os.environ.get("SCODOC_TEST_SERVER_NAME") or "localhost" class TestConfig(DevConfig):