forked from ScoDoc/ScoDoc
API: formsemestre/bulletins au format long_mat.
This commit is contained in:
parent
287e4df74e
commit
4c730a6302
@ -147,11 +147,13 @@ def formsemestres_query():
|
|||||||
|
|
||||||
|
|
||||||
@bp.route("/formsemestre/<int:formsemestre_id>/bulletins")
|
@bp.route("/formsemestre/<int:formsemestre_id>/bulletins")
|
||||||
|
@bp.route("/formsemestre/<int:formsemestre_id>/bulletins/<string:version>")
|
||||||
@api_web_bp.route("/formsemestre/<int:formsemestre_id>/bulletins")
|
@api_web_bp.route("/formsemestre/<int:formsemestre_id>/bulletins")
|
||||||
|
@api_web_bp.route("/formsemestre/<int:formsemestre_id>/bulletins/<string:version>")
|
||||||
@login_required
|
@login_required
|
||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoView)
|
@permission_required(Permission.ScoView)
|
||||||
def bulletins(formsemestre_id: int):
|
def bulletins(formsemestre_id: int, version: str = "long"):
|
||||||
"""
|
"""
|
||||||
Retourne les bulletins d'un formsemestre donné
|
Retourne les bulletins d'un formsemestre donné
|
||||||
|
|
||||||
@ -162,12 +164,16 @@ def bulletins(formsemestre_id: int):
|
|||||||
query = FormSemestre.query.filter_by(id=formsemestre_id)
|
query = FormSemestre.query.filter_by(id=formsemestre_id)
|
||||||
if g.scodoc_dept:
|
if g.scodoc_dept:
|
||||||
query = query.filter_by(dept_id=g.scodoc_dept_id)
|
query = query.filter_by(dept_id=g.scodoc_dept_id)
|
||||||
formsemestre: FormSemestre = query.first_or_404(formsemestre_id)
|
formsemestre: FormSemestre = query.first()
|
||||||
|
if formsemestre is None:
|
||||||
|
return json_error(404, "formsemestre non trouve")
|
||||||
app.set_sco_dept(formsemestre.departement.acronym)
|
app.set_sco_dept(formsemestre.departement.acronym)
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
for etu in formsemestre.etuds:
|
for etu in formsemestre.etuds:
|
||||||
bul_etu = get_formsemestre_bulletin_etud_json(formsemestre, etu)
|
bul_etu = get_formsemestre_bulletin_etud_json(
|
||||||
|
formsemestre, etu, version=version
|
||||||
|
)
|
||||||
data.append(bul_etu.json)
|
data.append(bul_etu.json)
|
||||||
|
|
||||||
return jsonify(data)
|
return jsonify(data)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
SCOVERSION = "9.4.5"
|
SCOVERSION = "9.4.6"
|
||||||
|
|
||||||
SCONAME = "ScoDoc"
|
SCONAME = "ScoDoc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user