1
0
forked from ScoDoc/ScoDoc

Améliore quelques routes et msg erreurs

This commit is contained in:
Emmanuel Viennet 2022-02-15 13:15:56 +01:00
parent c361ccb362
commit 75232a18a3
5 changed files with 10 additions and 5 deletions

View File

@ -302,7 +302,12 @@ class DisplayedGroupsInfos(object):
if group_ids: if group_ids:
group_ids = [group_ids] # cas ou un seul parametre, pas de liste group_ids = [group_ids] # cas ou un seul parametre, pas de liste
else: else:
try:
group_ids = [int(g) for g in group_ids] group_ids = [int(g) for g in group_ids]
except ValueError as exc:
raise ScoValueError(
"identifiant de groupe invalide (mettre à jour vos bookmarks ?)"
) from exc
if not formsemestre_id and moduleimpl_id: if not formsemestre_id and moduleimpl_id:
mods = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id) mods = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id)
if len(mods) != 1: if len(mods) != 1:

View File

@ -397,7 +397,7 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""):
) )
@bp.route("/ue_infos/<ue_id>") @bp.route("/ue_infos/<int:ue_id>")
@scodoc @scodoc
@permission_required(Permission.ScoView) @permission_required(Permission.ScoView)
def ue_infos(ue_id): def ue_infos(ue_id):

View File

@ -68,7 +68,7 @@ from app.scodoc.sco_permissions import Permission
@bp.route("/table_modules_ue_coefs/<int:formation_id>") @bp.route("/table_modules_ue_coefs/<int:formation_id>")
@bp.route("/table_modules_ue_coefs/<int:formation_id>/<semestre_idx>") @bp.route("/table_modules_ue_coefs/<int:formation_id>/<int:semestre_idx>")
@scodoc @scodoc
@permission_required(Permission.ScoView) @permission_required(Permission.ScoView)
def table_modules_ue_coefs(formation_id, semestre_idx=None): def table_modules_ue_coefs(formation_id, semestre_idx=None):

View File

@ -121,7 +121,7 @@ def create_dept():
) )
@bp.route("/ScoDoc/toggle_dept_vis/<dept_id>", methods=["GET", "POST"]) @bp.route("/ScoDoc/toggle_dept_vis/<int:dept_id>", methods=["GET", "POST"])
@admin_required @admin_required
def toggle_dept_vis(dept_id): def toggle_dept_vis(dept_id):
"""Cache ou rend visible un dept""" """Cache ou rend visible un dept"""

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.1.56" SCOVERSION = "9.1.57"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"