refactor: use sessionmaker().begin() in console workspace and misc co… (#34284)

This commit is contained in:
Desel72
2026-03-31 17:28:05 +03:00
committed by GitHub
parent 2c8b47ce44
commit dbdbb098d5
8 changed files with 29 additions and 30 deletions

View File

@@ -2,7 +2,7 @@ from collections.abc import Callable
from functools import wraps
from typing import ParamSpec, TypeVar
from sqlalchemy.orm import Session
from sqlalchemy.orm import sessionmaker
from werkzeug.exceptions import Forbidden
from extensions.ext_database import db
@@ -24,7 +24,7 @@ def plugin_permission_required(
user = current_user
tenant_id = current_tenant_id
with Session(db.engine) as session:
with sessionmaker(db.engine).begin() as session:
permission = (
session.query(TenantPluginPermission)
.where(