From a160ab51bfc25b8a299757a0fb0aff8609c90739 Mon Sep 17 00:00:00 2001 From: Michael Volo Date: Fri, 18 Oct 2024 13:19:32 -0500 Subject: [PATCH] variable name cleanup --- salesforce/management/commands/update_opportunities.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/salesforce/management/commands/update_opportunities.py b/salesforce/management/commands/update_opportunities.py index ff2d89e0..c6fe2185 100644 --- a/salesforce/management/commands/update_opportunities.py +++ b/salesforce/management/commands/update_opportunities.py @@ -11,10 +11,9 @@ def handle(self, *args, **options): with Salesforce() as sf: now = datetime.datetime.now() - year = now.year + base_year = now.year if now.month >= 7: # Salesforce needs the school base year, this is how they calculate it - year = year - 1 - + base_year -= 1 # truncate the table AdoptionOpportunityRecord.objects.all().delete() @@ -34,7 +33,7 @@ def handle(self, *args, **options): "FROM Adoption__c WHERE " "Base_Year__c = {} AND Opportunity__r.Contact__r.Accounts_UUID__c != null " "AND Confirmation_Type__c = 'OpenStax Confirmed Adoption' " - "AND Opportunity__r.Contact__r.Adoption_Status != 'Current Adopter'").format(year) + "AND Opportunity__r.Contact__r.Adoption_Status__c != 'Current Adopter' LIMIT 100").format(base_year) response = sf.query(query) records = response['records']