diff --git a/marietje/stats/templates/stats/stats.html b/marietje/stats/templates/stats/stats.html
index d388541..bdaa8e6 100644
--- a/marietje/stats/templates/stats/stats.html
+++ b/marietje/stats/templates/stats/stats.html
@@ -35,7 +35,7 @@
{{ forloop.counter }} |
{{ stat.user__name }} |
{{ stat.total }} |
- ({% widthratio stat.total stats.total_uploads 100 %}%) |
+ ({% widthratio stat.total stats.total_uploads_perc 100 %}%) |
{% endfor %}
@@ -61,7 +61,7 @@
{{ forloop.counter }} |
{{ stat.user__name }} |
{{ stat.total }} |
- ({% widthratio stat.total stats.total_requests 100 %}%) |
+ ({% widthratio stat.total stats.total_requests_perc 100 %}%) |
{% endfor %}
@@ -98,7 +98,7 @@
Unique requests
-
In total {{stats.total_unique_requests.total}} different songs
+
In total {{stats.total_unique_requests}} different songs
have been requested. The {{ stats.stats_top_count }} people that have requested the largest number of
different songs are shown below.
diff --git a/marietje/stats/utils.py b/marietje/stats/utils.py
index 519c0d9..61f26b1 100644
--- a/marietje/stats/utils.py
+++ b/marietje/stats/utils.py
@@ -155,11 +155,13 @@ def compute_stats():
return {
'last_updated': last_updated,
'total_uploads': "{0:,.0f}".format(stats['total_uploads']),
+ 'total_uploads_perc': stats['total_uploads'],
'upload_stats': list(stats['upload_stats']),
'total_requests': "{0:,.0f}".format(stats['total_requests']),
+ 'total_requests_perc': stats['total_requests'],
'request_stats': list(stats['request_stats']),
'unique_request_stats': list(stats['unique_request_stats']),
- 'total_unique_requests': stats['total_unique_requests'],
+ 'total_unique_requests': "{0:,.0f}".format(stats['total_unique_requests']['total']),
'most_played_songs': list(stats['most_played_songs']),
'most_played_songs_14_days': list(stats['most_played_songs_14_days']),
'time_requested': stats['time_requested'],