From 66f4be99ad922ca7b83d4b4a18352aa8cc59ec17 Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Tue, 12 Nov 2024 12:06:51 +0100 Subject: [PATCH] Do not explicitly begin() a transaction. This code is raising an InvalidRequestError. --- packit_service/models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packit_service/models.py b/packit_service/models.py index 4058f305b..d22c276b9 100644 --- a/packit_service/models.py +++ b/packit_service/models.py @@ -23,7 +23,6 @@ from cachetools import TTLCache, cached from cachetools.func import ttl_cache -from packit.config import JobConfigTriggerType from sqlalchemy import ( JSON, Boolean, @@ -55,6 +54,7 @@ from sqlalchemy.sql.functions import count from sqlalchemy.types import ARRAY +from packit.config import JobConfigTriggerType from packit_service.constants import ALLOWLIST_CONSTANTS logger = logging.getLogger(__name__) @@ -2342,8 +2342,6 @@ def add_scan_transaction(self) -> Generator["OSHScanModel"]: raise: IntegrityError if the scan model already exists """ session = singleton_session or Session() - session.begin() - try: scan = OSHScanModel() scan.copr_build_target = self