Skip to content

Commit

Permalink
variable name cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Oct 18, 2024
1 parent d05cd3c commit a160ab5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions salesforce/management/commands/update_opportunities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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']
Expand Down

0 comments on commit a160ab5

Please sign in to comment.