From 716c159648808cebedaa24f1cbf3036067017ccb Mon Sep 17 00:00:00 2001 From: Olaf Slomp Date: Sat, 28 Mar 2020 13:15:42 +0100 Subject: [PATCH] even more indentation fixes. --- marietje/stats/utils.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/marietje/stats/utils.py b/marietje/stats/utils.py index 2d0fb2e..d7ac10b 100644 --- a/marietje/stats/utils.py +++ b/marietje/stats/utils.py @@ -205,9 +205,9 @@ def user_stats(request): most_played_artists = PlaylistSong.objects.filter( user__id=request, state=2, - song_id__isnull=False).values('song__artist').annotate( - total=Count('song__artist')).order_by('-total', - 'song__artist')[:settings.STATS_TOP_COUNT] + song_id__isnull=False).values('song__artist').annotate( + total=Count('song__artist')).order_by( + '-total', 'song__artist')[:settings.STATS_TOP_COUNT] most_played_uploaders = PlaylistSong.objects.filter( user__id=request, state=2).exclude( @@ -230,15 +230,13 @@ def user_stats(request): user__id=None).values('song__artist', 'song__title').annotate( total=Count('id', filter=~Q(user__id=request)), user_total=Count('id', filter=Q(user__id=request))).order_by( - '-total', 'song__artist', - 'song__title') + '-total', 'song__artist', 'song__title') most_played_uploaded_artists = PlaylistSong.objects.filter( state=2, song_id__in=Song.objects.filter(user__id=request)).exclude( user__id=None).values('song__artist').annotate(total=Count('song__artist', - filter=~Q(user__id=request)), user_total=Count('id', - filter=Q(user__id=request))).order_by( - '-total', 'song__artist') + filter=~Q(user__id=request)), user_total=Count('id', + filter=Q(user__id=request))).order_by('-total', 'song__artist') most_played = list(most_played_uploads) total_played_uploads = 0