Commit 227f6cf757fcfe3cd0cdaca898a4027630524b8e
1 parent
fa28668f
Exists in
master
and in
2 other branches
sorted data by day in crescent order, by brute-force sorting
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
analytics/views.py
... | ... | @@ -65,7 +65,10 @@ def most_active_users_in_a_month(request): |
65 | 65 | built_date = date(int(year), mappings[_(month)], day) |
66 | 66 | days_list.append(built_date) |
67 | 67 | data = activity_in_timestamp(days_list, params = params) |
68 | + | |
68 | 69 | data = [{"day": day.day, "count": day_count} for day, day_count in data.items()] |
70 | + data = sorted(data, key =lambda x: x['day']) | |
71 | + | |
69 | 72 | return JsonResponse(data, safe=False) |
70 | 73 | |
71 | 74 | ... | ... |