diff --git a/logs/templates/logs/aff_stats_users.html b/logs/templates/logs/aff_stats_users.html index e8914f51..46994192 100644 --- a/logs/templates/logs/aff_stats_users.html +++ b/logs/templates/logs/aff_stats_users.html @@ -1,8 +1,3 @@ - - {% for key_dict, stats_dict in stats_list.items %} {% for key, stats in stats_dict.items %} diff --git a/logs/views.py b/logs/views.py index 82fc464b..4d5c7f9c 100644 --- a/logs/views.py +++ b/logs/views.py @@ -126,9 +126,9 @@ def stats_users(request): start_date = timezone.now() + relativedelta(months=-search_field[1]) stats = { 'Utilisateur' : { - 'Machines' : User.objects.filter(registered__gt=search_field[1]).annotate(num=Count('machine')).order_by('-num')[:10], - 'Facture' : User.objects.filter(registered__gt=search_field[1]).annotate(num=Count('facture')).order_by('-num')[:10], - 'Bannissement' : User.objects.filter(registered__gt=search_field[1]).annotate(num=Count('ban')).order_by('-num')[:10], + 'Machines' : User.objects.annotate(num=Count('machine')).order_by('-num')[:10], + 'Facture' : User.objects.annotate(num=Count('facture')).order_by('-num')[:10], + 'Bannissement' : User.objects.annotate(num=Count('ban')).order_by('-num')[:10], 'Accès gracieux' : User.objects.annotate(num=Count('whitelist')).order_by('-num')[:10], 'Droits' : User.objects.annotate(num=Count('right')).order_by('-num')[:10], },