From c708d9c3efa0faeb81a35a3045d88b7401da5874 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Fri, 1 Apr 2022 21:42:17 +0200 Subject: [PATCH] :card_file_box: Only count verified users --- classquiz/routers/stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classquiz/routers/stats.py b/classquiz/routers/stats.py index 40237c2..746cb36 100644 --- a/classquiz/routers/stats.py +++ b/classquiz/routers/stats.py @@ -27,7 +27,7 @@ async def get_quiz_count() -> int: async def get_user_count() -> int: redis_res = await redis.get("global_user_count") if redis_res is None: - quiz_res = await User.objects.count() + quiz_res = await User.objects.filter(verified=True).count() await redis.set("global_user_count", quiz_res, ex=3600) return quiz_res else: @@ -45,7 +45,7 @@ async def get_combined_count() -> CombinedOutput: quiz_count = None redis_res = await redis.get("global_user_count") if redis_res is None: - quiz_res = await User.objects.count() + quiz_res = await User.objects.filter(verified=True).count() await redis.set("global_user_count", quiz_res, ex=3600) user_count = quiz_res else: