Skip to content

Commit

Permalink
do not get records for users that are current adopters
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Oct 18, 2024
1 parent c99462a commit 5c216b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion salesforce/management/commands/update_opportunities.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def handle(self, *args, **options):
"Opportunity__r.Contact__r.Accounts_UUID__c "
"FROM Adoption__c WHERE "
"Base_Year__c = {} AND Opportunity__r.Contact__r.Accounts_UUID__c != null "
"AND Confirmation_Type__c = 'OpenStax Confirmed Adoption'").format(year)
"AND Confirmation_Type__c = 'OpenStax Confirmed Adoption' "
"AND Opportunity__r.Contact__r.Adoption_Status != 'Current Adopter'").format(year)

response = sf.query(query)
records = response['records']
Expand Down
1 change: 1 addition & 0 deletions salesforce/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def list(self, request):
account_uuid = request.GET.get('account_uuid', False)
# a user can have many adoption records - one for each book
# 10/2024 - added new data that can be used on the form, will need coordination with the FE form
# see https://github.com/openstax/openstax-cms/pull/1585
queryset = AdoptionOpportunityRecord.objects.filter(account_uuid=account_uuid)
book_list = []
for record in queryset:
Expand Down

0 comments on commit 5c216b8

Please sign in to comment.