fix: profile page 2
This commit is contained in:
parent
6a537a9b68
commit
ceed7c2c4a
@ -18,7 +18,7 @@ class ProfileViewSet(viewsets.ModelViewSet):
|
|||||||
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
|
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
|
||||||
|
|
||||||
def retrieve(self, request: HttpRequest, pk=None):
|
def retrieve(self, request: HttpRequest, pk=None):
|
||||||
if (self.queryset().filter(pk=pk)):
|
if (not self.queryset().filter(pk=pk).exists()):
|
||||||
return Response({"detail": "Profile not found."}, status=status.HTTP_404_NOT_FOUND)
|
return Response({"detail": "Profile not found."}, status=status.HTTP_404_NOT_FOUND)
|
||||||
instance = self.queryset().get(pk=pk)
|
instance = self.queryset().get(pk=pk)
|
||||||
instance.avatar_url.name = instance.avatar_url.name[instance.avatar_url.name.find("static") - 1:]
|
instance.avatar_url.name = instance.avatar_url.name[instance.avatar_url.name.find("static") - 1:]
|
||||||
|
Loading…
Reference in New Issue
Block a user