Commit faaae386 authored by Daniel Gal's avatar Daniel Gal
Browse files

Permission handling by hand

parent 07d71da9
Pipeline #2805 passed with stage
in 1 minute and 49 seconds
......@@ -45,10 +45,15 @@ class ProfileViewSet(
return queryset
@action(detail=False)
@action(detail=False, permission_classes=[])
def me(self, request):
serializer = serializers.OwnProfileSerializer(request.user.profile, many=False)
return Response(serializer.data)
try:
serializer = serializers.OwnProfileSerializer(
request.user.profile, many=False
)
return Response(serializer.data)
except AttributeError:
return Response(status=401)
class AvatarViewSet(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment