forked from ScoDoc/ScoDoc
Fix: API group/<int:group_id>/etudiants restreint aux inscrits au semestre
This commit is contained in:
parent
b04930870e
commit
7a4cff2623
@ -110,7 +110,7 @@ def formsemestre_partitions(formsemestre_id: int):
|
||||
def etud_in_group(group_id: int):
|
||||
"""
|
||||
Retourne la liste des étudiants dans un groupe
|
||||
|
||||
(inscrits au groupe et inscrits au semestre).
|
||||
group_id : l'id d'un groupe
|
||||
|
||||
Exemple de résultat :
|
||||
@ -133,7 +133,15 @@ def etud_in_group(group_id: int):
|
||||
query.join(Partition).join(FormSemestre).filter_by(dept_id=g.scodoc_dept_id)
|
||||
)
|
||||
group = query.first_or_404()
|
||||
return [etud.to_dict_short() for etud in group.etuds]
|
||||
|
||||
query = (
|
||||
Identite.query.join(group_membership)
|
||||
.filter_by(group_id=group_id)
|
||||
.join(FormSemestreInscription)
|
||||
.filter_by(formsemestre_id=group.partition.formsemestre_id)
|
||||
)
|
||||
|
||||
return [etud.to_dict_short() for etud in query]
|
||||
|
||||
|
||||
@bp.route("/group/<int:group_id>/etudiants/query")
|
||||
@ -161,7 +169,6 @@ def etud_in_group_query(group_id: int):
|
||||
query = query.filter_by(etat=etat)
|
||||
|
||||
query = query.join(group_membership).filter_by(group_id=group_id)
|
||||
|
||||
return [etud.to_dict_short() for etud in query]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user