2022-08-03 13:32:59 +02:00
|
|
|
##############################################################################
|
|
|
|
# ScoDoc
|
2023-01-02 13:16:27 +01:00
|
|
|
# Copyright (c) 1999 - 2023 Emmanuel Viennet. All rights reserved.
|
2022-08-03 13:32:59 +02:00
|
|
|
# See LICENSE
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
"""
|
2023-02-06 13:05:39 +01:00
|
|
|
ScoDoc 9 API : jury WIP
|
2022-08-03 13:32:59 +02:00
|
|
|
"""
|
|
|
|
|
2023-04-06 16:10:32 +02:00
|
|
|
from flask_json import as_json
|
2022-08-03 13:32:59 +02:00
|
|
|
from flask_login import login_required
|
|
|
|
|
|
|
|
import app
|
|
|
|
from app.api import api_bp as bp, api_web_bp
|
|
|
|
from app.decorators import scodoc, permission_required
|
2022-08-17 18:15:48 +02:00
|
|
|
from app.scodoc.sco_exceptions import ScoException
|
2023-02-06 13:05:39 +01:00
|
|
|
from app.but import jury_but_results
|
|
|
|
from app.models import FormSemestre
|
2022-08-03 13:32:59 +02:00
|
|
|
from app.scodoc.sco_permissions import Permission
|
|
|
|
|
|
|
|
|
|
|
|
@bp.route("/formsemestre/<int:formsemestre_id>/decisions_jury")
|
|
|
|
@api_web_bp.route("/formsemestre/<int:formsemestre_id>/decisions_jury")
|
|
|
|
@login_required
|
|
|
|
@scodoc
|
|
|
|
@permission_required(Permission.ScoView)
|
2023-04-06 16:10:32 +02:00
|
|
|
@as_json
|
2022-08-03 13:32:59 +02:00
|
|
|
def decisions_jury(formsemestre_id: int):
|
|
|
|
"""Décisions du jury des étudiants du formsemestre."""
|
|
|
|
# APC, pair:
|
|
|
|
formsemestre: FormSemestre = FormSemestre.query.get(formsemestre_id)
|
2022-08-17 18:15:48 +02:00
|
|
|
if formsemestre.formation.is_apc():
|
|
|
|
app.set_sco_dept(formsemestre.departement.acronym)
|
2023-02-06 13:05:39 +01:00
|
|
|
rows = jury_but_results.get_jury_but_results(formsemestre)
|
2023-04-06 16:10:32 +02:00
|
|
|
return rows
|
2022-08-17 18:15:48 +02:00
|
|
|
else:
|
|
|
|
raise ScoException("non implemente")
|