update readme
This commit is contained in:
@@ -41,6 +41,9 @@ class LifecycleEvents(str, Enum):
|
||||
# Archive the course after the certificate expires
|
||||
COURSE_ARCHIVED = 'schedules#course_archived'
|
||||
|
||||
# When the access period ends for a course without a certificate
|
||||
COURSE_EXPIRED = 'schedules#course_expired'
|
||||
|
||||
|
||||
def enroll(
|
||||
enrollment: Enrollment,
|
||||
@@ -95,6 +98,18 @@ def enroll(
|
||||
},
|
||||
)
|
||||
|
||||
transact.put(
|
||||
item={
|
||||
'id': enrollment.id,
|
||||
'sk': LifecycleEvents.COURSE_EXPIRED,
|
||||
'name': user.name,
|
||||
'email': user.email,
|
||||
'course': course.name,
|
||||
'create_date': now_,
|
||||
'ttl': ttl(start_dt=now_ + timedelta(days=course.access_period)),
|
||||
},
|
||||
)
|
||||
|
||||
return persistence_layer.transact_write_items(transact)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user