Merge pull request #20049 from edx/aj/entitlement_expiration

Aj/entitlement expiration
This commit is contained in:
Albert (AJ) St. Aubin
2019-03-25 11:08:29 -04:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -18,3 +18,4 @@ class EntitlementsConfig(AppConfig):
Connect handlers to signals.
"""
from . import signals # pylint: disable=unused-variable
from .tasks import expire_old_entitlements

View File

@@ -42,7 +42,7 @@ def expire_old_entitlements(self, start, end, logid='...'):
# This query could be optimized to return a more narrow set, but at a
# complexity cost. See bug LEARNER-3451 about improving it.
entitlements = CourseEntitlement.objects.filter(expired_at__isnull=True, id__gte=start, id__lt=end)
entitlements = CourseEntitlement.objects.filter(expired_at__isnull=True, id__gte=start, id__lte=end)
countdown = 2 ** self.request.retries