mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
12794 change User ref to get_user_model (#12905)
* 12794 change User ref to get_user_model * 12794 call get_user_model once in tests * 12794 call get_user_model once in tests * 12794 use settings.AUTH_USER_MODEL for FK reference
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import graphene
|
||||
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import Group
|
||||
from netbox.graphql.fields import ObjectField, ObjectListField
|
||||
from .types import *
|
||||
from utilities.graphql_optimizer import gql_query_optimizer
|
||||
@@ -17,4 +18,4 @@ class UsersQuery(graphene.ObjectType):
|
||||
user_list = ObjectListField(UserType)
|
||||
|
||||
def resolve_user_list(root, info, **kwargs):
|
||||
return gql_query_optimizer(User.objects.all(), info)
|
||||
return gql_query_optimizer(get_user_model().objects.all(), info)
|
||||
|
Reference in New Issue
Block a user