forked from ScoDoc/ScoDoc
modif exceptions
This commit is contained in:
parent
f5ee63dd5c
commit
123af7067c
@ -203,7 +203,7 @@ class BaseArchiver(object):
|
|||||||
log(
|
log(
|
||||||
f"invalid archive name: {archive_name}, oid={oid}, archive_id={archive_id}"
|
f"invalid archive name: {archive_name}, oid={oid}, archive_id={archive_id}"
|
||||||
)
|
)
|
||||||
raise ValueError("invalid archive name")
|
raise ScoValueError(f"Archive {archive_name} introuvable")
|
||||||
return archive_id
|
return archive_id
|
||||||
|
|
||||||
def get_archive_description(self, archive_id):
|
def get_archive_description(self, archive_id):
|
||||||
|
@ -103,7 +103,7 @@ def do_module_create(args) -> int:
|
|||||||
if formation.is_apc():
|
if formation.is_apc():
|
||||||
ue = UniteEns.query.get(args["ue_id"])
|
ue = UniteEns.query.get(args["ue_id"])
|
||||||
if int(args.get("semestre_id", 0)) != ue.semestre_idx:
|
if int(args.get("semestre_id", 0)) != ue.semestre_idx:
|
||||||
raise ValueError("Formation incompatible: contacter le support ScoDoc")
|
raise ScoValueError("Formation incompatible: contacter le support ScoDoc")
|
||||||
# create
|
# create
|
||||||
cnx = ndb.GetDBConnexion()
|
cnx = ndb.GetDBConnexion()
|
||||||
module_id = _moduleEditor.create(cnx, args)
|
module_id = _moduleEditor.create(cnx, args)
|
||||||
|
@ -105,7 +105,7 @@ def get_group(group_id: int) -> dict:
|
|||||||
{"group_id": group_id},
|
{"group_id": group_id},
|
||||||
)
|
)
|
||||||
if not r:
|
if not r:
|
||||||
raise ValueError("invalid group_id (%s)" % group_id)
|
raise ScoValueError(f"Groupe inexistant ! (id {group_id})")
|
||||||
return r[0]
|
return r[0]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user