Skip to content

Commit

Permalink
Fixes: #14840 - Forces API to use proxy model
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Jan 20, 2024
1 parent ebf6ce1 commit df85cc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netbox/users/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from netbox.api.viewsets import NetBoxModelViewSet
from users import filtersets
from users.models import ObjectPermission, Token, UserConfig
from users.models import ObjectPermission, Token, UserConfig, NetBoxUser
from utilities.querysets import RestrictedQuerySet
from utilities.utils import deepmerge
from . import serializers
Expand All @@ -34,7 +34,7 @@ def get_view_name(self):
#

class UserViewSet(NetBoxModelViewSet):
queryset = RestrictedQuerySet(model=get_user_model()).prefetch_related('groups').order_by('username')
queryset = RestrictedQuerySet(model=NetBoxUser).prefetch_related('groups').order_by('username')
serializer_class = serializers.UserSerializer
filterset_class = filtersets.UserFilterSet

Expand Down

0 comments on commit df85cc9

Please sign in to comment.