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:
parent
4c858ab8b5
commit
3a2f095ab6
2 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue