This commit is contained in:
2025-07-09 13:44:39 -03:00
parent 690be35634
commit 72b1338135
7 changed files with 66 additions and 27 deletions

View File

@@ -16,8 +16,8 @@ def create_course(
transact.put(
item={
'sk': '0',
'tenant': org.id,
'create_date': now_,
'tenant_id': {org.id},
'created_at': now_,
**course.model_dump(),
}
)
@@ -27,7 +27,7 @@ def create_course(
'sk': 'metadata#tenant',
'org_id': org.id,
'name': org.name,
'create_date': now_,
'created_at': now_,
}
)
@@ -46,7 +46,7 @@ def update_course(
transact.update(
key=KeyPair(id, '0'),
update_expr='SET #name = :name, access_period = :access_period, \
cert = :cert, update_date = :update_date',
cert = :cert, updated_at = :updated_at',
expr_attr_names={
'#name': 'name',
},
@@ -54,7 +54,7 @@ def update_course(
':name': course.name,
':cert': course.cert.model_dump() if course.cert else None,
':access_period': course.access_period,
':update_date': now_,
':updated_at': now_,
},
cond_expr='attribute_exists(sk)',
)