mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 08:37:48 -02:30
Don't reverse sync preload script data (#6644)
Signed-off-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from crum import impersonate
|
from crum import impersonate
|
||||||
|
from ansible_base.resource_registry.signals.handlers import no_reverse_sync
|
||||||
from awx.main.models import User, Organization, Project, Inventory, CredentialType, Credential, Host, JobTemplate
|
from awx.main.models import User, Organization, Project, Inventory, CredentialType, Credential, Host, JobTemplate
|
||||||
from awx.main.signals import disable_computed_fields
|
from awx.main.signals import disable_computed_fields
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ class Command(BaseCommand):
|
|||||||
def handle(self, *args, **kwargs):
|
def handle(self, *args, **kwargs):
|
||||||
# Wrap the operation in an atomic block, so we do not on accident
|
# Wrap the operation in an atomic block, so we do not on accident
|
||||||
# create the organization but not create the project, etc.
|
# create the organization but not create the project, etc.
|
||||||
|
with no_reverse_sync():
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
self._handle()
|
self._handle()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user