diff --git a/common/djangoapps/entitlements/management/commands/expire_and_create_entitlements.py b/common/djangoapps/entitlements/management/commands/expire_and_create_entitlements.py index 1949213ce2..aea02c5dd6 100644 --- a/common/djangoapps/entitlements/management/commands/expire_and_create_entitlements.py +++ b/common/djangoapps/entitlements/management/commands/expire_and_create_entitlements.py @@ -67,7 +67,7 @@ class Command(BaseCommand): expiration_period = current_date - relativedelta(years=1) exceptional_expiration_period = current_date - relativedelta(years=1, months=6) normal_entitlements = CourseEntitlement.objects.filter( - expired_at__isnull=True,created__lte=expiration_period, + expired_at__isnull=True, created__lte=expiration_period, enrollment_course_run__isnull=True).exclude(course_uuid__in=MIT_SUPPLY_CHAIN_COURSES) exceptional_entitlements = CourseEntitlement.objects.filter( diff --git a/common/djangoapps/entitlements/tasks.py b/common/djangoapps/entitlements/tasks.py index a0a7e13078..a3a57a571f 100644 --- a/common/djangoapps/entitlements/tasks.py +++ b/common/djangoapps/entitlements/tasks.py @@ -113,9 +113,9 @@ def expire_and_create_entitlements(self, entitlements, support_user): 'support_user': support_user, } CourseEntitlementSupportDetail.objects.create(**support_detail) - LOGGER.info('created new entitlement with id %d in a correspondence of above expired entitlement', new_entitlement.id) # lint-amnesty, pylint: disable=line-too-long + LOGGER.info('created new entitlement with id %d in a correspondence of above expired entitlement', new_entitlement.id) # lint-amnesty, pylint: disable=line-too-long except Exception as exc: - LOGGER.exception('Failed to expire entitlements that reached their expiration period',) + LOGGER.exception('Failed to expire entitlements that reached their expiration period',) # pylint: disable=broad-except LOGGER.info('Successfully completed the task expire_and_create_entitlements after examining %d entries', entitlements.count()) # lint-amnesty, pylint: disable=line-too-long