update menu
This commit is contained in:
@@ -64,7 +64,8 @@ def put_course(course_id: str):
|
||||
event = router.current_event
|
||||
|
||||
if not event.decoded_body:
|
||||
raise BadRequestError('Invalid request body') now_ = now()
|
||||
raise BadRequestError('Invalid request body')
|
||||
|
||||
body = parse(
|
||||
event.headers,
|
||||
BytesIO(event.decoded_body.encode()),
|
||||
@@ -98,7 +99,7 @@ def put_course(course_id: str):
|
||||
':cert': course.cert.model_dump(),
|
||||
':access_period': course.access_period,
|
||||
':draft': course.draft,
|
||||
':updated_at': now_,
|
||||
':updated_at': now(),
|
||||
},
|
||||
cond_expr='attribute_exists(sk)',
|
||||
exc_cls=BadRequestError,
|
||||
|
||||
@@ -21,5 +21,9 @@ dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
|
||||
@router.get('/<enrollment_id>')
|
||||
def get_enrollment(enrollment_id: str):
|
||||
return dyn.collection.get_items(
|
||||
TransactKey(enrollment_id) + SortKey('0') + SortKey('ORG') + SortKey('LOCK')
|
||||
TransactKey(enrollment_id)
|
||||
+ SortKey('0')
|
||||
+ SortKey('ORG', rename_key='org')
|
||||
+ SortKey('CANCEL_POLICY', rename_key='cancel_policy')
|
||||
+ SortKey('LOCK', rename_key='lock')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user