diff --git a/core/userlists.py b/core/userlists.py index 2384a3b4..a31cea56 100644 --- a/core/userlists.py +++ b/core/userlists.py @@ -32,3 +32,12 @@ def work_list_users(work_list, how_many): else : user_list = work.wished_by()[0: how_many] return user_list + +def campaign_list_users(campaign_list, how_many): + users = User.objects.filter(wishlist__works__campaigns__in=campaign_list).distinct().reverse() + count = users.count() + if count <= how_many : + user_list = users[0: count] + else : + user_list = work.wished_by()[0: how_many] + return user_list diff --git a/frontend/templates/campaign_list.html b/frontend/templates/campaign_list.html index d0c86e47..cb480811 100644 --- a/frontend/templates/campaign_list.html +++ b/frontend/templates/campaign_list.html @@ -24,10 +24,11 @@