diff --git a/backend/api/services/exoValidation.py b/backend/api/services/exoValidation.py index 208b67d..80825e7 100644 --- a/backend/api/services/exoValidation.py +++ b/backend/api/services/exoValidation.py @@ -1,19 +1,20 @@ import ast -from multiprocessing import Manager +import os import random import re import string -from fastapi.exceptions import HTTPException -from fastapi import UploadFile, status +from multiprocessing import Manager + import sympy -from tortoise.validators import Validator +from fastapi import UploadFile, status +from fastapi.exceptions import HTTPException from tortoise.exceptions import ValidationError -import types -from services.timeout import Process + from services.io import is_binary_file -import os -VALIDATED_MODULES = ["random", "string", "sympy"] +from services.timeout import Process + +VALIDATED_MODULES = ["random", "string", "sympy", "math"] def checkExoSupportCompatibility(obj): isPdf = False if (obj['pdf'] == None or ( obj['calcul'] == False and obj['pdf'] == False)) else True