diff --git a/opentech/apply/users/management/commands/migrate_users.py b/opentech/apply/users/management/commands/migrate_users.py index 9e13f18e688ad6971f0a0cabb1a95b72ea64539e..eafd1d0863c294bae10621d6c9d39113ff00b957 100644 --- a/opentech/apply/users/management/commands/migrate_users.py +++ b/opentech/apply/users/management/commands/migrate_users.py @@ -3,6 +3,7 @@ import json from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand +from django.db import transaction class Command(BaseCommand): @@ -17,6 +18,7 @@ class Command(BaseCommand): help='Perform a run dry-run', ) + @transaction.atomic def handle(self, *args, **options): with options['source'] as json_data: User = get_user_model()