mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 16:06:43 -06:00
12336 make region API calls atomic
This commit is contained in:
parent
786f0cc7f3
commit
e038e6ac40
@ -1,3 +1,4 @@
|
|||||||
|
from django.db import transaction
|
||||||
from django.http import Http404, HttpResponse
|
from django.http import Http404, HttpResponse
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from drf_spectacular.types import OpenApiTypes
|
from drf_spectacular.types import OpenApiTypes
|
||||||
@ -109,6 +110,18 @@ class RegionViewSet(NetBoxModelViewSet):
|
|||||||
serializer_class = serializers.RegionSerializer
|
serializer_class = serializers.RegionSerializer
|
||||||
filterset_class = filtersets.RegionFilterSet
|
filterset_class = filtersets.RegionFilterSet
|
||||||
|
|
||||||
|
@transaction.atomic
|
||||||
|
def create(self, request, *args, **kwargs):
|
||||||
|
return super().create(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@transaction.atomic
|
||||||
|
def update(self, request, *args, **kwargs):
|
||||||
|
return super().update(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@transaction.atomic
|
||||||
|
def destroy(self, request, *args, **kwargs):
|
||||||
|
return super().destroy(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Site groups
|
# Site groups
|
||||||
|
Loading…
Reference in New Issue
Block a user