diff options
author | Simon Ruderich <simon@ruderich.org> | 2013-11-11 21:36:50 +0100 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2013-11-11 22:19:56 -0600 |
commit | b7479fa7dc6d87135fb328dbf9ba4bcd81a5db53 (patch) | |
tree | ce1dc6702ad457b06a818baf08d916bdc9190de3 /src/lib/Bcfg2/Server/Reports/reports/models.py | |
parent | 103b1b5198828876fa0684296900769018075f1b (diff) | |
download | bcfg2-b7479fa7dc6d87135fb328dbf9ba4bcd81a5db53.tar.gz bcfg2-b7479fa7dc6d87135fb328dbf9ba4bcd81a5db53.tar.bz2 bcfg2-b7479fa7dc6d87135fb328dbf9ba4bcd81a5db53.zip |
Fix compatibility with Django 1.6.
Diffstat (limited to 'src/lib/Bcfg2/Server/Reports/reports/models.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Reports/reports/models.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/reports/models.py b/src/lib/Bcfg2/Server/Reports/reports/models.py index 73adaaaaf..c43c3cee7 100644 --- a/src/lib/Bcfg2/Server/Reports/reports/models.py +++ b/src/lib/Bcfg2/Server/Reports/reports/models.py @@ -9,11 +9,13 @@ except ImproperlyConfigured: print("Reports: unable to import django models: %s" % e) sys.exit(1) -from django.db import connection, transaction +from django.db import connection from django.db.models import Q from datetime import datetime, timedelta from time import strptime +from Bcfg2.Reporting.Compat import transaction + KIND_CHOICES = ( #These are the kinds of config elements ('Package', 'Package'), @@ -288,7 +290,7 @@ class Reason(models.Model): return rv @staticmethod - @transaction.commit_on_success + @transaction.atomic def prune_orphans(): '''Prune oprhaned rows... no good way to use the ORM''' cursor = connection.cursor() @@ -305,7 +307,7 @@ class Entries(models.Model): return self.name @staticmethod - @transaction.commit_on_success + @transaction.atomic def prune_orphans(): '''Prune oprhaned rows... no good way to use the ORM''' cursor = connection.cursor() @@ -334,7 +336,7 @@ class Performance(models.Model): return self.metric @staticmethod - @transaction.commit_on_success + @transaction.atomic def prune_orphans(): '''Prune oprhaned rows... no good way to use the ORM''' cursor = connection.cursor() |