1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-22 02:18:21 +02:00

Add profile and membership information to OAuth views

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
2021-03-09 10:57:35 +01:00
parent b244e01231
commit 72806f0ace
2 changed files with 48 additions and 5 deletions

View File

@ -4,11 +4,14 @@
from django.contrib.auth.models import User
from rest_framework.generics import RetrieveAPIView
from .serializers import UserSerializer
from .serializers import OAuthSerializer
class UserInformationView(RetrieveAPIView):
serializer_class = UserSerializer
"""
These fields are give to OAuth authenticators.
"""
serializer_class = OAuthSerializer
def get_queryset(self):
return User.objects.filter(pk=self.request.user.pk)