Skip to content

Commit

Permalink
feat: fixed failing checks related to linting and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zubair-ce07 committed Jun 26, 2023
1 parent 3f84b14 commit 2d0a8b4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions common/djangoapps/entitlements/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ def expire_and_create_entitlements(self, entitlement_ids, support_username):
len(entitlement_ids),
first_entitlement_id,
last_entitlement_id,
self.id
self.request.id
)

try:
for entitlement_id in entitlement_ids:
entitlement = CourseEntitlement.objects.get(id=entitlement_id)
log.info('Started expiring entitlement with id %d, task id :%s',
entitlement.id,
self.id)
self.request.id)
entitlement.expire_entitlement()
log.info('Expired entitlement with id %d as expiration period has reached, task id :%s',
entitlement.id,
self.id)
self.request.id)
support_detail = {
'action': 'EXPIRE',
'comments': 'REV-3574',
Expand All @@ -135,16 +135,18 @@ def expire_and_create_entitlements(self, entitlement_ids, support_username):
}
CourseEntitlementSupportDetail.objects.create(**support_detail)
log.info(
'created new entitlement with id %d corresponding to above expired entitlement with id %d, task id :%s ',
'created new entitlement with id %d corresponding to above expired entitlement'
'with id %d, task id :%s ',
new_entitlement.id,
entitlement.id,
self.id
self.request.id
)

except Exception as exc: # pylint: disable=broad-except
log.exception('Failed to expire entitlements that reached their expiration period, task id :%s',
self.id)
self.request.id)

log.info('Successfully completed the task expire_and_create_entitlements after examining %d entries, task id :%s',
log.info('Successfully completed the task expire_and_create_entitlements after examining'
'%d entries, task id :%s',
len(entitlement_ids),
self.id)
self.request.id)

0 comments on commit 2d0a8b4

Please sign in to comment.