add try/except in _create_doc()

main
jgenero 3 years ago
parent dee966c2b7
commit 67a056d885

@ -99,6 +99,11 @@ def _create_doc(folder: str)-> None:
# query on table institution with <doc_archives> to get the correspondant institution key # query on table institution with <doc_archives> to get the correspondant institution key
inst_query = [t.id_institution for t in Institution.select().where( inst_query = [t.id_institution for t in Institution.select().where(
Institution.full_label == doc_archives)] Institution.full_label == doc_archives)]
try:
inst_query[0]
except IndexError:
print("!! Add", doc_archives, "to /app/data_actes/institution_data.py")
break
infos_doc.append({ infos_doc.append({
"inst_doc": inst_query[0], "inst_doc": inst_query[0],
"collection_doc": doc_cote, "collection_doc": doc_cote,

Loading…
Cancel
Save