update create_date field
This commit is contained in:
@@ -23,7 +23,7 @@ dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
|
||||
|
||||
@app.post('/')
|
||||
@tracer.capture_method
|
||||
def update_enrollment():
|
||||
def postback():
|
||||
json_body = app.current_event.json_body
|
||||
|
||||
status = json_body['status']
|
||||
|
||||
@@ -65,6 +65,7 @@ def update_progress(
|
||||
':progress': progress,
|
||||
':updated_at': now_,
|
||||
},
|
||||
exc_cls=EnrollmentConflictError,
|
||||
)
|
||||
# Record the start date if it does not already exist
|
||||
transact.put(
|
||||
@@ -140,7 +141,9 @@ def set_score(
|
||||
user_id=user_id,
|
||||
course_id=course_id,
|
||||
cert_exp_interval=int(
|
||||
glom(enrollment, 'metadata__course.cert.exp_interval')
|
||||
glom(
|
||||
enrollment, 'metadata__course.cert.exp_interval', default=0
|
||||
)
|
||||
),
|
||||
dedup_window_offset_days=int(
|
||||
enrollment['dedup_window_offset_days']
|
||||
@@ -216,6 +219,8 @@ def _set_status_as_completed(
|
||||
},
|
||||
cond_expr='attribute_not_exists(sk)',
|
||||
)
|
||||
|
||||
if cert_exp_interval:
|
||||
transact.put(
|
||||
item={
|
||||
'id': id,
|
||||
@@ -249,6 +254,7 @@ def _set_status_as_completed(
|
||||
'created_at': now_,
|
||||
}
|
||||
)
|
||||
|
||||
# Remove reminders and policies that no longer apply
|
||||
transact.delete(
|
||||
key=KeyPair(
|
||||
@@ -420,4 +426,6 @@ class EnrollmentNotFoundError(NotFoundError):
|
||||
super().__init__('Enrollment not found')
|
||||
|
||||
|
||||
class EnrollmentConflictError(BadRequestError): ...
|
||||
class EnrollmentConflictError(BadRequestError):
|
||||
def __init__(self, *_):
|
||||
super().__init__('Enrollment conflict')
|
||||
|
||||
Reference in New Issue
Block a user