small fixes

This commit is contained in:
oslomp
2019-02-15 22:58:21 +01:00
parent 530c44affa
commit 25769d40e0
2 changed files with 1 additions and 6 deletions

View File

@ -107,11 +107,6 @@ CACHES = {
'LOCATION': '/var/tmp/MarietjeDjango_cache/default',
'OPTIONS': {'MAX_ENTRIES': 1500},
},
'userstats': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': '/var/tmp/MarietjeDjango_cache/default',
'OPTIONS': { 'MAX_ENTRIES': 1500 },
},
}
AUTH_USER_MODEL = 'marietje.User'

View File

@ -216,7 +216,7 @@ def user_stats(request):
total_played_uploads += x['total']
total_played_user_uploads += x['user_total']
most_played_uploads_list = sorted(most_played_uploads, key=lambda x: (x['song__artist'], x['song__title']))
most_played_uploads_list = sorted(most_played_uploads_list, key=lambda x:x["total"], reverse=True)[:settings.STATS_TOP_COUNT]
most_played_uploads_list = sorted(most_played_uploads_list, key=lambda x: x["total"], reverse=True)[:settings.STATS_TOP_COUNT]
return {
'last_updated': last_updated,
'total_uploads': total_uploads,