1
0
forked from ScoDoc/ScoDoc

Merge PE v4

This commit is contained in:
Emmanuel Viennet 2024-02-27 21:23:45 +01:00
parent ce63b7f2f5
commit 5c9126d263
2 changed files with 4 additions and 4 deletions

View File

@ -187,7 +187,7 @@ def dept_etudiants(acronym: str):
] ]
""" """
dept = Departement.query.filter_by(acronym=acronym).first_or_404() 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/<int:dept_id>/etudiants") @bp.route("/departement/id/<int:dept_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é. Retourne la liste des étudiants d'un département d'id donné.
""" """
dept = Departement.query.get_or_404(dept_id) 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/<string:acronym>/formsemestres_ids") @bp.route("/departement/<string:acronym>/formsemestres_ids")

View File

@ -61,11 +61,11 @@ class DevConfig(Config):
DEBUG = True DEBUG = True
TESTING = False TESTING = False
SQLALCHEMY_DATABASE_URI = ( 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" SECRET_KEY = os.environ.get("DEV_SECRET_KEY") or "bb3faec7d9a34eb68a8e3e710087d87a"
# pour le avoir url_for dans le shell: # 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): class TestConfig(DevConfig):