mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 14:59:36 +02:00
fix: Update URL path for user stats counts and remove email from response
This commit is contained in:
parent
3c9aec4bfb
commit
4759ff71a1
2 changed files with 3 additions and 3 deletions
|
@ -14,13 +14,13 @@ class StatsViewSet(viewsets.ViewSet):
|
|||
"""
|
||||
A simple ViewSet for listing the stats of a user.
|
||||
"""
|
||||
@action(detail=False, methods=['get'], url_path='counts/(?P<username>[^/.]+)')
|
||||
@action(detail=False, methods=['get'], url_path='counts/(?P<username>[\w.@+-]+)')
|
||||
def counts(self, request, username):
|
||||
if request.user.username == username:
|
||||
user = get_object_or_404(User, username=username)
|
||||
else:
|
||||
user = get_object_or_404(User, username=username, public_profile=True)
|
||||
serializer = PublicUserSerializer(user)
|
||||
# serializer = PublicUserSerializer(user)
|
||||
|
||||
# remove the email address from the response
|
||||
user.email = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue