1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

9856 update types

This commit is contained in:
Arthur
2024-02-26 11:04:29 -08:00
parent 82c08d9820
commit 0387cb0a48
6 changed files with 84 additions and 75 deletions

View File

@ -1,3 +1,5 @@
from typing import List
import strawberry
import strawberry_django
from django.contrib.auth import get_user_model
@ -36,3 +38,7 @@ class UserType:
@classmethod
def get_queryset(cls, queryset, info, **kwargs):
return RestrictedQuerySet(model=get_user_model()).restrict(info.context.request.user, 'view')
@strawberry_django.field
def groups(self) -> List[GroupType]:
return self.groups.all()