mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 21:09:37 +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)
|
||||
|
|
|
@ -91,6 +91,9 @@
|
|||
/>
|
||||
</div>
|
||||
{/each}
|
||||
{#if sharedWithUsers.length === 0}
|
||||
<p class="text-neutral-content">No users shared with</p>
|
||||
{/if}
|
||||
</ul>
|
||||
<div class="divider"></div>
|
||||
<h3 class="font-bold text-md">Not Shared With</h3>
|
||||
|
@ -106,6 +109,9 @@
|
|||
/>
|
||||
</div>
|
||||
{/each}
|
||||
{#if notSharedWithUsers.length === 0}
|
||||
<p class="text-neutral-content">No users not shared with</p>
|
||||
{/if}
|
||||
</ul>
|
||||
<button class="btn btn-primary mt-4" on:click={close}>Close</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue