gva/gnuviechadmin/help/views.py
Jan Dittberner 5cf7ef7a23 Strip API to required minimum
- disable browseable API
- use IsAdminUser for DEFAULT_PERMISSION_CLASSES
- register explicit API views for HelpUser model
2023-04-16 14:34:45 +02:00

26 lines
632 B
Python

from rest_framework import generics
from help.models import HelpUser
from help.serializers import HelpUserSerializer
class ListHelpUserAPIView(generics.ListAPIView):
"""
API endpoint that allows user help profile to be viewed or edited.
"""
queryset = (
HelpUser.objects.all().prefetch_related("user").order_by("user__username")
)
serializer_class = HelpUserSerializer
class HelpUserAPIView(generics.RetrieveUpdateAPIView):
"""
API endpoint that allows user help profile to be viewed or edited.
"""
queryset = HelpUser.objects.all()
serializer_class = HelpUserSerializer