Skip to content

Commit

Permalink
Fixed API widget for Prefix assignment to View objects
Browse files Browse the repository at this point in the history
  • Loading branch information
peteeckel committed Aug 16, 2024
1 parent 337f213 commit ea5962b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions netbox_dns/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from rest_framework.routers import APIRootView

from ipam.models import Prefix
from ipam.filtersets import PrefixFilterSet

from netbox.api.viewsets import NetBoxModelViewSet

Expand Down Expand Up @@ -160,3 +161,4 @@ class RecordTemplateViewSet(NetBoxModelViewSet):
class PrefixViewSet(NetBoxModelViewSet):
queryset = Prefix.objects.all()
serializer_class = PrefixSerializer
filterset_class = PrefixFilterSet
3 changes: 0 additions & 3 deletions netbox_dns/fields/ipam.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@


class PrefixDynamicModelMultipleChoiceField(DynamicModelMultipleChoiceField):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

widget = APISelectMultiple(api_url="/api/plugins/netbox-dns/prefixes")

def label_from_instance(self, obj):
Expand Down

0 comments on commit ea5962b

Please sign in to comment.