Merge pull request #303 from mouse-reeve/nodeinfo-user-count

Only report local users in user count
This commit is contained in:
Mouse Reeve 2020-11-07 12:39:47 -08:00 committed by GitHub
commit 65770b8dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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