add postgres
This commit is contained in:
@@ -5,7 +5,6 @@ from http import HTTPStatus
|
||||
from aws_lambda_powertools.event_handler.api_gateway import Router
|
||||
from layercake.batch import BatchProcessor
|
||||
from layercake.dynamodb import (
|
||||
DynamoDBCollection,
|
||||
DynamoDBPersistenceLayer,
|
||||
)
|
||||
from pydantic import BaseModel
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user