Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Esterello2 committed Dec 7, 2023
1 parent c804cfa commit 9506857
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/chigame/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def create(self, validated_data):
class FriendInvitationSerializer(serializers.ModelSerializer):
class Meta:
model = FriendInvitation
fields = "__all__"


class GroupSerializer(serializers.ModelSerializer):
Expand Down
10 changes: 6 additions & 4 deletions src/chigame/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import generics, status
from rest_framework.pagination import PageNumberPagination
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView

Expand Down Expand Up @@ -86,6 +85,12 @@ class LobbyDetailView(generics.RetrieveUpdateDestroyAPIView):
serializer_class = LobbySerializer


class UserListView(generics.ListCreateAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
pagination_class = PageNumberPagination


# Bug with PATCH'ing emails -- refer to Issue #394
class UserDetailView(generics.RetrieveUpdateDestroyAPIView):
queryset = User.objects.all()
Expand Down Expand Up @@ -155,12 +160,9 @@ def post(self, request, *args, **kwargs):
class UserProfileListView(generics.ListAPIView):
queryset = UserProfile.objects.all()
serializer_class = UserProfileSerializer
permission_classes = [IsAuthenticated]


class UserProfileUpdateView(APIView):
permission_classes = [IsAuthenticated]

def patch(self, request, *args, **kwargs):
user_profile_pk = self.kwargs["user_profile_pk"]
user_profile = get_object_or_404(UserProfile, pk=user_profile_pk)
Expand Down

0 comments on commit 9506857

Please sign in to comment.