Skip to content

Commit

Permalink
Do not explicitly begin() a transaction.
Browse files Browse the repository at this point in the history
This code is raising an InvalidRequestError.
  • Loading branch information
majamassarini committed Nov 12, 2024
1 parent f04011d commit 66f4be9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packit_service/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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__)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 66f4be9

Please sign in to comment.