formsemestre_recapcomplet: 404 if invalid formsemestre_id

This commit is contained in:
Emmanuel Viennet 2022-05-10 18:18:44 +02:00
parent 04bda84228
commit 4eb08ec1d4

View File

@ -32,7 +32,7 @@ import time
from xml.etree import ElementTree
from flask import g, request
from flask import url_for
from flask import abort, url_for
from app import log
from app.but import bulletin_but
@ -83,6 +83,8 @@ def formsemestre_recapcomplet(
force_publishing: publie les xml et json même si bulletins non publiés
selected_etudid: etudid sélectionné (pour scroller au bon endroit)
"""
if not isinstance(formsemestre_id, int):
abort(404)
formsemestre = FormSemestre.query.get_or_404(formsemestre_id)
file_formats = {"csv", "json", "xls", "xlsx", "xlsall", "xml"}
supported_formats = file_formats | {"html", "evals"}