mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
19644 set atomic transactions to appropriate database
This commit is contained in:
parent
78f1e7d618
commit
9e2248cbf1
@ -295,7 +295,7 @@ class AvailableObjectsView(ObjectValidationMixin, APIView):
|
||||
|
||||
# Create the new IP address(es)
|
||||
try:
|
||||
with transaction.atomic(using=router.db_for_write(serializer.Meta.model)):
|
||||
with transaction.atomic(using=router.db_for_write(self.queryset.model)):
|
||||
created = serializer.save()
|
||||
self._validate_objects(created)
|
||||
except ObjectDoesNotExist:
|
||||
|
Loading…
Reference in New Issue
Block a user