From 34527d820d03a82965340d9fd27041c35b025917 Mon Sep 17 00:00:00 2001 From: Chibuotu Amadi Date: Mon, 4 Oct 2021 20:15:43 +0100 Subject: [PATCH] fix usage of get_clr_rounds_metadata (#9559) --- app/grants/management/commands/sent_cart_reminder.py | 2 +- app/grants/views.py | 4 ++-- app/marketing/management/commands/post_data.py | 2 +- app/perftools/management/commands/create_page_cache.py | 2 +- app/retail/utils.py | 2 +- scripts/debug/add_squelched_profiles.py | 2 +- scripts/debug/address_usage_finder.py | 2 +- scripts/debug/grants_collusion_stats.py | 2 +- scripts/debug/grants_export.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/grants/management/commands/sent_cart_reminder.py b/app/grants/management/commands/sent_cart_reminder.py index f592bee3838..1a18ca29dc9 100644 --- a/app/grants/management/commands/sent_cart_reminder.py +++ b/app/grants/management/commands/sent_cart_reminder.py @@ -51,7 +51,7 @@ def add_arguments(self, parser): def handle(self, *args, **options): - _, round_start_date, round_end_date, _ = get_clr_rounds_metadata() + _, round_start_date, round_end_date, _, _, _, _, _ = get_clr_rounds_metadata() last_activity_by_user = CartActivity.objects.filter(latest=True, created_on__gt=round_start_date).exclude(metadata=[]) count = 0 diff --git a/app/grants/views.py b/app/grants/views.py index 6c9fe635f35..b0fd2e98cbf 100644 --- a/app/grants/views.py +++ b/app/grants/views.py @@ -1024,7 +1024,7 @@ def grants_by_grant_type(request, grant_type): if _type.get("keyword") == grant_type: grant_label = _type.get("label") - _, round_start_date, round_end_date, _ = get_clr_rounds_metadata() + _, round_start_date, round_end_date, _, _, _, _, _ = get_clr_rounds_metadata() params = { 'active': 'grants_explorer', @@ -1208,7 +1208,7 @@ def grants_by_grant_clr(request, clr_round): active_rounds = GrantCLR.objects.filter(is_active=True, start_date__lt=timezone.now(), end_date__gt=timezone.now()).order_by('-total_pot') - _, round_start_date, round_end_date, _ = get_clr_rounds_metadata() + _, round_start_date, round_end_date, _, _, _, _, _ = get_clr_rounds_metadata() params = { 'active': 'grants_landing', diff --git a/app/marketing/management/commands/post_data.py b/app/marketing/management/commands/post_data.py index b1bef4ee292..edbe7fb3511 100644 --- a/app/marketing/management/commands/post_data.py +++ b/app/marketing/management/commands/post_data.py @@ -280,7 +280,7 @@ def earners(days, cadence): def grants(): - clr_round, _, _, _ = get_clr_rounds_metadata() + clr_round, _, _, _, _, _, _, _ = get_clr_rounds_metadata() active_clr_rounds = GrantCLR.objects.filter(is_active=True, customer_name='ethereum', start_date__lt=timezone.now(), end_date__gt=timezone.now()) if not active_clr_rounds.exists(): return diff --git a/app/perftools/management/commands/create_page_cache.py b/app/perftools/management/commands/create_page_cache.py index 7455bc11d47..b352a052f6c 100644 --- a/app/perftools/management/commands/create_page_cache.py +++ b/app/perftools/management/commands/create_page_cache.py @@ -109,7 +109,7 @@ def create_hack_event_cache(): def create_top_grant_spenders_cache(): - _, round_start_date, _, _ = get_clr_rounds_metadata() + _, round_start_date, _, _, _, _, _, _ = get_clr_rounds_metadata() grant_types = GrantType.objects.filter(is_visible=True, is_active=True) for grant_type in grant_types: diff --git a/app/retail/utils.py b/app/retail/utils.py index 39d17148134..fbfa539f5e1 100644 --- a/app/retail/utils.py +++ b/app/retail/utils.py @@ -637,7 +637,7 @@ def get_kudos_leaderboard(key='kudos_token.artist'): context['median_contribution'] = round(Contribution.objects.order_by("subscription__amount_per_period_usdt")[median_index].subscription.amount_per_period_usdt, 2) context['avg_contribution'] = round(grants_gmv / num_contributions, 2) from grants.utils import get_clr_rounds_metadata - clr_round, _, _, _ = get_clr_rounds_metadata() + clr_round, _, _, _, _, _, _, _ = get_clr_rounds_metadata() context['num_matching_rounds'] = clr_round context['ads_served'] = str(round(ManualStat.objects.filter(key='ads_served').order_by('-pk').first().val / 10**6, 1)) + "m" context['privacy_violations'] = ManualStat.objects.filter(key='privacy_violations').order_by('-pk').first().val diff --git a/scripts/debug/add_squelched_profiles.py b/scripts/debug/add_squelched_profiles.py index ac5164c0735..8574ade8a95 100644 --- a/scripts/debug/add_squelched_profiles.py +++ b/scripts/debug/add_squelched_profiles.py @@ -9,7 +9,7 @@ # total stats -_, round_start_date, round_end_date, _ = get_clr_rounds_metadata() +_, round_start_date, round_end_date, _, _, _, _, _ = get_clr_rounds_metadata() contributions = Contribution.objects.filter(created_on__gt=round_start_date, created_on__lt=round_end_date, success=True) pfs = PhantomFunding.objects.filter(created_on__gt=round_start_date, created_on__lt=round_end_date) diff --git a/scripts/debug/address_usage_finder.py b/scripts/debug/address_usage_finder.py index f337f2faf05..f2acc3c9361 100644 --- a/scripts/debug/address_usage_finder.py +++ b/scripts/debug/address_usage_finder.py @@ -8,7 +8,7 @@ # total stats -_, round_start_date, round_end_date, _ = get_clr_rounds_metadata() +_, round_start_date, round_end_date, _, _, _, _, _ = get_clr_rounds_metadata() contributions = Contribution.objects.filter(created_on__gt=round_start_date, created_on__lt=round_end_date, success=True) pfs = PhantomFunding.objects.filter(created_on__gt=round_start_date, created_on__lt=round_end_date) diff --git a/scripts/debug/grants_collusion_stats.py b/scripts/debug/grants_collusion_stats.py index d909bad0f3f..bcf8ddba62b 100644 --- a/scripts/debug/grants_collusion_stats.py +++ b/scripts/debug/grants_collusion_stats.py @@ -6,7 +6,7 @@ # total stats -_, round_start_date, round_end_date, _ = get_clr_rounds_metadata() +_, round_start_date, round_end_date, _, _, _, _, _ = get_clr_rounds_metadata() contributions = Contribution.objects.filter(created_on__gt=round_start_date, created_on__lt=round_end_date, success=True) diff --git a/scripts/debug/grants_export.py b/scripts/debug/grants_export.py index 2cec4d0d471..0e1bb221da5 100644 --- a/scripts/debug/grants_export.py +++ b/scripts/debug/grants_export.py @@ -1,7 +1,7 @@ from grants.models import Grant from grants.utils import get_clr_rounds_metadata -clr_round, _, _, _ = get_clr_rounds_metadata() +clr_round, _, _, _, _, _, _, _ = get_clr_rounds_metadata() # total stats