add: profiles.all()

This commit is contained in:
2023-12-08 17:36:41 +01:00
parent 54afa8aae5
commit 0edcd97f94
6 changed files with 37 additions and 4 deletions

View File

@ -22,6 +22,12 @@ class ProfileViewSet(viewsets.ModelViewSet):
return Response(self.serializer_class(instance).data,
status=status.HTTP_200_OK)
def get_queryset(self):
profiles = ProfileModel.objects.all()
for profile in profiles:
profile.avatar_url.name = profile.avatar_url.name.replace("profiles", "", 1)
return profiles
def perform_create(self, serializer):
serializer.save(user=self.request.user)