exception -handling

This commit is contained in:
Emmanuel Viennet 2022-02-26 20:11:22 +01:00
parent dbab59039c
commit c1c9f22a31
2 changed files with 6 additions and 2 deletions

View File

@ -39,6 +39,7 @@ from app.scodoc.gen_tables import GenTable
from app.scodoc import html_sco_header from app.scodoc import html_sco_header
from app.scodoc import sco_etud from app.scodoc import sco_etud
from app.scodoc import sco_groups from app.scodoc import sco_groups
from app.scodoc.sco_exceptions import ScoException
from app.scodoc.sco_permissions import Permission from app.scodoc.sco_permissions import Permission
from app.scodoc import sco_preferences from app.scodoc import sco_preferences
@ -221,7 +222,10 @@ def search_etuds_infos(expnom=None, code_nip=None):
cnx = ndb.GetDBConnexion() cnx = ndb.GetDBConnexion()
if expnom and not may_be_nip: if expnom and not may_be_nip:
expnom = expnom.upper() # les noms dans la BD sont en uppercase expnom = expnom.upper() # les noms dans la BD sont en uppercase
try:
etuds = sco_etud.etudident_list(cnx, args={"nom": expnom}, test="~") etuds = sco_etud.etudident_list(cnx, args={"nom": expnom}, test="~")
except ScoException:
etuds = []
else: else:
code_nip = code_nip or expnom code_nip = code_nip or expnom
if code_nip: if code_nip:

View File

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