Skip to content
Snippets Groups Projects
Commit 936d3913 authored by Julian's avatar Julian
Browse files

Make person list queryable

parent f2284c35
No related branches found
No related tags found
1 merge request!1433Resolve "Use more crudlists in core"
......@@ -75,7 +75,7 @@ class Query(graphene.ObjectType):
notifications = graphene.List(NotificationType)
persons = graphene.List(PersonType)
persons = FilterOrderList(PersonType)
person_by_id = graphene.Field(PersonType, id=graphene.ID())
person_by_id_or_me = graphene.Field(PersonType, id=graphene.ID())
......
......@@ -8,10 +8,11 @@ from graphene_django import DjangoObjectType
from graphene_django.forms.mutation import DjangoModelFormMutation
from guardian.shortcuts import get_objects_for_user
from ..filters import PersonFilter
from ..forms import PersonForm
from ..models import DummyPerson, Person
from ..util.core_helpers import get_site_preferences, has_person
from .base import FieldFileType
from .base import DjangoFilterMixin, FieldFileType, PermissionsTypeMixin
from .notification import NotificationType
......@@ -22,7 +23,7 @@ class PersonPreferencesType(graphene.ObjectType):
return parent["theme__design"]
class PersonType(DjangoObjectType):
class PersonType(PermissionsTypeMixin, DjangoFilterMixin, DjangoObjectType):
class Meta:
model = Person
fields = [
......@@ -51,6 +52,7 @@ class PersonType(DjangoObjectType):
"owner_of",
"member_of",
]
filterset_class = PersonFilter
full_name = graphene.String()
username = graphene.String()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment