From 62b4c5b5fb3c519095b046a7f0d5002038e5e46b Mon Sep 17 00:00:00 2001 From: Kevin Owocki Date: Sun, 19 Dec 2021 17:14:40 -0700 Subject: [PATCH 1/3] fixes https://gitcoin.atlassian.net/browse/GITC-678 --- app/retail/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/retail/views.py b/app/retail/views.py index 232177d3dd9..865e22725ac 100644 --- a/app/retail/views.py +++ b/app/retail/views.py @@ -801,7 +801,7 @@ def get_specific_activities(what, trending_only, user, after_pk, request=None, p # single activity if 'activity:' in what: - activities = Activity.objects.filter(activities_index__key=what.replace('activity:', '')) + activities = Activity.objects.filter(pk=what.replace('activity:', '')) filter_applied = True # Defaults From 9ce41f2b7093a32b1af9eba4321dd2ca5b65c8a2 Mon Sep 17 00:00:00 2001 From: Kevin Owocki Date: Mon, 20 Dec 2021 17:59:16 -0700 Subject: [PATCH 2/3] corrects an issue with how gmv totals were calculated --- app/retail/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/retail/utils.py b/app/retail/utils.py index ca34ef36cd2..4e6eca8e0fd 100644 --- a/app/retail/utils.py +++ b/app/retail/utils.py @@ -536,10 +536,12 @@ def get_kudos_leaderboard(key='kudos_token.artist'): pp.profile_time('completion_rate') bounty_abandonment_rate = round(100 - completion_rate, 1) total_bounties_usd = sum(base_bounties.exclude(idx_status__in=['expired', 'cancelled', 'canceled', 'unknown']).values_list('_val_usd_db', flat=True)) + total_bounties_usd += sum(ManualStat.objects.filter(key='bounty_gmv', date__lt=timezone.now()).values_list('val', flat=True)) total_tips_usd = sum([ tip.value_in_usdt for tip in Tip.objects.filter(network='mainnet').send_happy_path() if tip.value_in_usdt ]) + total_tips_usd += sum(ManualStat.objects.filter(key='tip_gmv', date__lt=timezone.now()).values_list('val', flat=True)) total_grants_usd = get_grants_history_at_date(timezone.now(), []) total_kudos_usd = get_kudos_history_at_date(timezone.now(), []) total_codefund_usd = get_codefund_history_at_date(timezone.now(), '') From 5521892cb2381e0508da6133c0a1709f1eb81139 Mon Sep 17 00:00:00 2001 From: Kevin Owocki Date: Mon, 20 Dec 2021 18:00:56 -0700 Subject: [PATCH 3/3] one more try --- app/retail/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/retail/utils.py b/app/retail/utils.py index 4e6eca8e0fd..893dfd7f328 100644 --- a/app/retail/utils.py +++ b/app/retail/utils.py @@ -535,13 +535,13 @@ def get_kudos_leaderboard(key='kudos_token.artist'): context['audience'] = json.loads(context['members_history'])[-1][1] pp.profile_time('completion_rate') bounty_abandonment_rate = round(100 - completion_rate, 1) - total_bounties_usd = sum(base_bounties.exclude(idx_status__in=['expired', 'cancelled', 'canceled', 'unknown']).values_list('_val_usd_db', flat=True)) - total_bounties_usd += sum(ManualStat.objects.filter(key='bounty_gmv', date__lt=timezone.now()).values_list('val', flat=True)) - total_tips_usd = sum([ + total_bounties_usd = float(sum(base_bounties.exclude(idx_status__in=['expired', 'cancelled', 'canceled', 'unknown']).values_list('_val_usd_db', flat=True))) + total_bounties_usd += float(sum(ManualStat.objects.filter(key='bounty_gmv', date__lt=timezone.now()).values_list('val', flat=True))) + total_tips_usd = float(sum([ tip.value_in_usdt for tip in Tip.objects.filter(network='mainnet').send_happy_path() if tip.value_in_usdt - ]) - total_tips_usd += sum(ManualStat.objects.filter(key='tip_gmv', date__lt=timezone.now()).values_list('val', flat=True)) + ])) + total_tips_usd += float(sum(ManualStat.objects.filter(key='tip_gmv', date__lt=timezone.now()).values_list('val', flat=True))) total_grants_usd = get_grants_history_at_date(timezone.now(), []) total_kudos_usd = get_kudos_history_at_date(timezone.now(), []) total_codefund_usd = get_codefund_history_at_date(timezone.now(), '')