Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit b8f5f961e8 - Show all commits

View File

@ -41,7 +41,7 @@ from app.scodoc.sco_exceptions import ScoValueError
import app.scodoc.sco_utils as scu
def get_ics_filename(edt_id: str) -> str:
def get_ics_filename(edt_id: str) -> str | None:
"Le chemin vers l'ics de cet edt_id"
edt_ics_path = ScoDocSiteConfig.get("edt_ics_path")
if not edt_ics_path.strip():
@ -62,6 +62,8 @@ def formsemestre_load_calendar(
"accès aux emplois du temps non configuré pour ce semestre (pas d'edt_id)"
)
ics_filename = get_ics_filename(edt_id)
if ics_filename is None:
raise ScoValueError("accès aux emplois du temps non configuré (pas de chemin)")
try:
with open(ics_filename, "rb") as file:
log(f"Loading edt from {ics_filename}")

View File

@ -70,6 +70,9 @@ def test_permissions(api_headers):
# par défaut, on passe tous les arguments de all_args
endpoint_args = {
"api.formsemestres_query": {},
"api.formsemestre_edt": {
"formsemestre_id": 1,
},
}
for rule in api_rules:
args = endpoint_args.get(rule.endpoint, all_args)