Commit 9755216a by Chris Rossi Committed by Diana Huang

Use whitelist for testing.

parent 35fdbf3a
...@@ -46,11 +46,15 @@ class Command(BaseCommand): ...@@ -46,11 +46,15 @@ class Command(BaseCommand):
self.api = LinkedinAPI() self.api = LinkedinAPI()
def handle(self, *args, **options): def handle(self, *args, **options):
whitelist = self.api.config.get('EMAIL_WHITELIST')
grandfather = options.get('grandfather', False) grandfather = options.get('grandfather', False)
accounts = LinkedIn.objects.filter(has_linkedin_account=True) accounts = LinkedIn.objects.filter(has_linkedin_account=True)
for account in accounts: for account in accounts:
emailed = json.loads(account.emailed_courses)
user = account.user user = account.user
if whitelist is not None and user.email not in whitelist:
# Whitelist only certain addresses for testing purposes
continue
emailed = json.loads(account.emailed_courses)
certificates = GeneratedCertificate.objects.filter(user=user) certificates = GeneratedCertificate.objects.filter(user=user)
certificates = certificates.filter(status='downloadable') certificates = certificates.filter(status='downloadable')
certificates = [cert for cert in certificates certificates = [cert for cert in certificates
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment