1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-24 07:19:36 +02:00

Sharing modal fixes and redact email for privacy

This commit is contained in:
Sean Morley 2024-09-10 09:59:59 -04:00
parent 4c858ab8b5
commit 3a2f095ab6
2 changed files with 11 additions and 0 deletions

View file

@ -60,6 +60,9 @@ class PublicUserListView(APIView):
)
def get(self, request):
users = User.objects.filter(public_profile=True).exclude(id=request.user.id)
# remove the email addresses from the response
for user in users:
user.email = None
serializer = PublicUserSerializer(users, many=True)
return Response(serializer.data, status=status.HTTP_200_OK)
@ -76,5 +79,7 @@ class PublicUserDetailView(APIView):
)
def get(self, request, user_id):
user = get_object_or_404(User, uuid=user_id, public_profile=True)
# remove the email address from the response
user.email = None
serializer = PublicUserSerializer(user)
return Response(serializer.data, status=status.HTTP_200_OK)