From ac74cb211819ef790e0bd63ee86aa3bcb02503b1 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 4 Sep 2024 13:17:58 -0400 Subject: [PATCH] #61: Address a regression in the original fix --- netbox_branching/models/branches.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_branching/models/branches.py b/netbox_branching/models/branches.py index 13dde35..1779157 100644 --- a/netbox_branching/models/branches.py +++ b/netbox_branching/models/branches.py @@ -245,11 +245,11 @@ def sync(self, user, commit=True): try: with activate_branch(self): - with transaction.atomic(): + with transaction.atomic(using=self.connection_name): # Apply each change from the main schema for change in self.get_unsynced_changes().order_by('time'): logger.debug(f'Applying change: {change}') - change.apply() + change.apply(using=self.connection_name) if not commit: raise AbortTransaction()