commit: 778c8f4d3c4663457b180a6c7cee2e6d85fd135e Author: Sebastian Pipping <sping <AT> gentoo <DOT> org> AuthorDate: Sun Feb 9 21:40:04 2020 +0000 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org> CommitDate: Sun Feb 9 23:16:35 2020 +0000 URL: https://gitweb.gentoo.org/proj/euscan.git/commit/?id=778c8f4d
Stop using django.db.transaction.commit_on_success for Django >=1.8 Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org> euscanwww/djeuscan/processing/misc/update_counters.py | 4 ++-- euscanwww/djeuscan/processing/scan/scan_metadata.py | 4 ++-- euscanwww/djeuscan/processing/scan/scan_portage.py | 4 ++-- euscanwww/djeuscan/processing/scan/scan_upstream.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/euscanwww/djeuscan/processing/misc/update_counters.py b/euscanwww/djeuscan/processing/misc/update_counters.py index 392b7b5..3abc6a2 100644 --- a/euscanwww/djeuscan/processing/misc/update_counters.py +++ b/euscanwww/djeuscan/processing/misc/update_counters.py @@ -1,4 +1,4 @@ -from django.db.transaction import commit_on_success +from django.db.transaction import atomic from django.utils import timezone from djeuscan.models import Package, Herd, Maintainer, Version, HerdLog, \ @@ -36,7 +36,7 @@ def _add_last_ver(storage, version): storage[key] = version -@commit_on_success +@atomic def update_counters(fast=False, nolog=False, logger=None): logger = logger or FakeLogger() diff --git a/euscanwww/djeuscan/processing/scan/scan_metadata.py b/euscanwww/djeuscan/processing/scan/scan_metadata.py index 22bad3f..16474f5 100644 --- a/euscanwww/djeuscan/processing/scan/scan_metadata.py +++ b/euscanwww/djeuscan/processing/scan/scan_metadata.py @@ -5,7 +5,7 @@ from gentoolkit.metadata import MetaData import xml.etree.cElementTree as etree -from django.db.transaction import commit_on_success +from django.db.transaction import atomic from django.core.management.color import color_style from django.core.exceptions import ValidationError @@ -236,7 +236,7 @@ class ScanMetadata(object): herd.maintainers.add(maintainer) -@commit_on_success +@atomic def scan_metadata(packages=None, category=None, logger=None, populate=False): scan_handler = ScanMetadata(logger=logger) diff --git a/euscanwww/djeuscan/processing/scan/scan_portage.py b/euscanwww/djeuscan/processing/scan/scan_portage.py index 857fce2..44abc2c 100644 --- a/euscanwww/djeuscan/processing/scan/scan_portage.py +++ b/euscanwww/djeuscan/processing/scan/scan_portage.py @@ -11,7 +11,7 @@ from layman import Layman from xml.etree.ElementTree import iterparse, ParseError -from django.db.transaction import commit_on_success +from django.db.transaction import atomic from django.db import models from django.core.management.color import color_style from django.conf import settings @@ -395,7 +395,7 @@ def populate_overlays(logger): logger.info("+ [o] %s", overlay) -@commit_on_success +@atomic def scan_portage(packages=None, category=None, no_log=False, upstream=False, purge_packages=False, purge_versions=False, logger=None): diff --git a/euscanwww/djeuscan/processing/scan/scan_upstream.py b/euscanwww/djeuscan/processing/scan/scan_upstream.py index dc7ba1b..2686202 100644 --- a/euscanwww/djeuscan/processing/scan/scan_upstream.py +++ b/euscanwww/djeuscan/processing/scan/scan_upstream.py @@ -1,7 +1,7 @@ import portage from django.utils import timezone -from django.db.transaction import commit_on_success +from django.db.transaction import atomic from euscan import CONFIG, output from euscan.scan import scan_upstream as euscan_scan_upstream @@ -150,7 +150,7 @@ class ScanUpstream(object): version.delete() -@commit_on_success +@atomic def scan_upstream(packages=None, purge_versions=False, logger=None): logger = logger or FakeLogger()