diff --git a/backend/geonature/utils/env.py b/backend/geonature/utils/env.py index bdd10a0a9a..527d8e091f 100644 --- a/backend/geonature/utils/env.py +++ b/backend/geonature/utils/env.py @@ -33,6 +33,8 @@ DB = db = SQLAlchemy() os.environ["FLASK_MARSHMALLOW"] = "geonature.utils.env.ma" MA = ma = Marshmallow() +ma.SQLAlchemySchema.OPTIONS_CLASS.session = db.session +ma.SQLAlchemyAutoSchema.OPTIONS_CLASS.session = db.session os.environ["FLASK_MIGRATE"] = "geonature.utils.env.migrate" migrate = Migrate()