From 4f44cc0e5617dc4df4aaebdec9494a65350782b3 Mon Sep 17 00:00:00 2001 From: gluap Date: Sat, 8 Jul 2023 14:05:23 +0200 Subject: [PATCH] fix per-user-statistics --- api/obs/api/routes/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/obs/api/routes/stats.py b/api/obs/api/routes/stats.py index 54bc82a..fa5d382 100644 --- a/api/obs/api/routes/stats.py +++ b/api/obs/api/routes/stats.py @@ -45,7 +45,7 @@ async def stats(req): # Only the user can look for their own stats, for now by_user = ( - user is not None and req.ctx.user is not None and req.ctx.user.username == user + user is not None and req.ctx.user is not None and req.ctx.user.id == int(user) ) if by_user: conditions.append(Track.author_id == req.ctx.user.id)