add postgres

This commit is contained in:
2025-08-26 00:00:42 -03:00
parent 1326530991
commit e33eccebb9
43 changed files with 622 additions and 636 deletions

View File

@@ -113,48 +113,6 @@ def enroll(
'created_at': now_,
},
)
transact.put(
item={
'id': enrollment.id,
# Post-migration: uncomment the following line
# 'sk': LifecycleEvents.REMINDER_NO_ACCESS_3_DAYS,
'sk': LifecycleEvents.DOES_NOT_ACCESS,
'name': user.name,
'email': user.email,
'course': course.name,
'created_at': now_,
'ttl': ttl(days=3, start_dt=now_),
},
)
# Enrollment expires by default when the access period ends.
# When the course is finished, it is automatically removed,
# and the `schedules#course_archived` event is created.
transact.put(
item={
'id': enrollment.id,
'sk': LifecycleEvents.EXPIRATION,
# Post-migration: uncomment the following line
# 'sk': LifecycleEvents.COURSE_EXPIRED,
'name': user.name,
'email': user.email,
'course': course.name,
'created_at': now_,
'ttl': ttl(start_dt=now_ + timedelta(days=course.access_period)),
},
)
transact.put(
item={
'id': enrollment.id,
# Post-migration: uncomment the following line
# 'sk': LifecycleEvents.ACCESS_PERIOD_REMINDER_30_DAYS,
'sk': LifecycleEvents.ACCESS_PERIOD_ENDS,
'name': user.name,
'email': user.email,
'course': course.name,
'created_at': now_,
'ttl': ttl(start_dt=now_ + timedelta(days=course.access_period - 30)),
},
)
for entity in linked_entities:
type = entity.type.lower()