diff --git a/backend/server/adventures/views/stats_view.py b/backend/server/adventures/views/stats_view.py index 37d9f07..4b3a524 100644 --- a/backend/server/adventures/views/stats_view.py +++ b/backend/server/adventures/views/stats_view.py @@ -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[^/.]+)') + @action(detail=False, methods=['get'], url_path='counts/(?P[\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 diff --git a/frontend/src/routes/dashboard/+page.server.ts b/frontend/src/routes/dashboard/+page.server.ts index a87a45a..c73b3c0 100644 --- a/frontend/src/routes/dashboard/+page.server.ts +++ b/frontend/src/routes/dashboard/+page.server.ts @@ -21,7 +21,7 @@ export const load = (async (event) => { let stats = null; let res = await event.fetch( - `${serverEndpoint}/api/stats/counts/${event.locals.user.username}`, + `${serverEndpoint}/api/stats/counts/${event.locals.user.username}/`, { headers: { Cookie: `sessionid=${event.cookies.get('sessionid')}`