Skip to content

Commit a22d3bc

Browse files
committed
Merge pull request #2 from BetterWorks/atomic
transaction atomic for perf improvement
2 parents 804f99d + 24e0b9b commit a22d3bc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

anonymizer/management/commands/anonymize_data.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""
2-
amonymize_data command
2+
anonymize_data command
33
"""
44

5-
from django.core.exceptions import ImproperlyConfigured
6-
from django.core.management.base import AppCommand, CommandError
5+
from django.core.management.base import AppCommand
6+
from django.db import transaction
77
from django.utils import importlib
88

99
from anonymizer import Anonymizer
1010

11+
1112
class Command(AppCommand):
1213

1314
def handle_app(self, app, **options):
@@ -38,5 +39,6 @@ def handle_app(self, app, **options):
3839

3940
anonymizers.sort(key=lambda c:c.order)
4041
for a in anonymizers:
41-
a().run()
42+
with transaction.atomic():
43+
a().run()
4244

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def read(*rnames):
99

1010
setup(
1111
name = "django-anonymizer",
12-
version = '0.5.0.2-bw',
12+
version = '0.5.0.3-bw',
1313
packages = find_packages(),
1414
include_package_data = True,
1515

0 commit comments

Comments
 (0)