From 3ba02f8fbd22be610bcd3c1146538f109b28c1af Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 7 Nov 2020 12:07:09 -0800 Subject: [PATCH] Only report local users in user count --- bookwyrm/wellknown.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/wellknown.py b/bookwyrm/wellknown.py index 9daf31ee..d670fb32 100644 --- a/bookwyrm/wellknown.py +++ b/bookwyrm/wellknown.py @@ -58,15 +58,17 @@ def nodeinfo(request): return HttpResponseNotFound() status_count = models.Status.objects.filter(user__local=True).count() - user_count = models.User.objects.count() + user_count = models.User.objects.filter(local=True).count() month_ago = datetime.now() - relativedelta(months=1) last_month_count = models.User.objects.filter( + local=True, last_active_date__gt=month_ago ).count() six_months_ago = datetime.now() - relativedelta(months=6) six_month_count = models.User.objects.filter( + local=True, last_active_date__gt=six_months_ago ).count() return JsonResponse({