Skip to content

Commit

Permalink
set BaseViewSet (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattieserver authored Aug 26, 2024
1 parent d2d2106 commit 19adcab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions netbox_topology_views/api/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import Dict
import sys

from netbox.api.viewsets import BaseViewSet

from circuits.models import Circuit
from dcim.models import Device, DeviceRole, PowerFeed, PowerPanel
from extras.models import SavedFilter
Expand All @@ -22,7 +24,7 @@
from netbox_topology_views.utils import get_image_from_url, export_data_to_xml, get_query_settings
from netbox_topology_views.filters import DeviceFilterSet

class SaveCoordsViewSet(PermissionRequiredMixin, ReadOnlyModelViewSet):
class SaveCoordsViewSet(BaseViewSet, ReadOnlyModelViewSet):
permission_required = 'netbox_topology_views.change_coordinate'

queryset = Device.objects.none()
Expand Down Expand Up @@ -89,9 +91,7 @@ def save_coords(self, request):

return Response({"status": "saved coords"})

class ExportTopoToXML(PermissionRequiredMixin, ViewSet):
permission_required = ("dcim.view_site", "dcim.view_device")

class ExportTopoToXML(BaseViewSet, ViewSet):
queryset = Device.objects.none()
serializer_class = TopologyDummySerializer

Expand Down Expand Up @@ -173,7 +173,7 @@ def list(self, request):
{"status": "Missing or malformed request parameters"}, status=400
)

class SaveRoleImageViewSet(PermissionRequiredMixin, ReadOnlyModelViewSet):
class SaveRoleImageViewSet(BaseViewSet, ReadOnlyModelViewSet):
queryset = DeviceRole.objects.none()
serializer_class = RoleImageSerializer
permission_required = (
Expand Down

0 comments on commit 19adcab

Please sign in to comment.