Only report local users in user count

This commit is contained in:
Mouse Reeve 2020-11-07 12:07:09 -08:00
parent 1b50e83c95
commit 3ba02f8fbd

View file

@ -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({