From df85cc967c2e951cb02c8ea3b9074dc6bd7dc301 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Sat, 20 Jan 2024 11:12:05 -0600 Subject: [PATCH] Fixes: #14840 - Forces API to use proxy model --- netbox/users/api/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/users/api/views.py b/netbox/users/api/views.py index 62a32c71b8b..487d4769c04 100644 --- a/netbox/users/api/views.py +++ b/netbox/users/api/views.py @@ -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 @@ -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