add draft

This commit is contained in:
2025-10-25 14:09:04 -03:00
parent 2fba9ba059
commit 29ecb87e45
4 changed files with 7 additions and 11 deletions

View File

@@ -47,6 +47,7 @@ class Course(BaseModel):
name: str
access_period: int
cert: Cert
draft: bool = False
rawfile: bytes | None = None
@@ -77,8 +78,11 @@ def edit_course(course_id: str):
with dyn.transact_writer() as transact:
transact.update(
key=KeyPair(str(course.id), '0'),
update_expr='SET #name = :name, access_period = :access_period, \
cert = :cert, updated_at = :updated_at',
update_expr='SET #name = :name, \
access_period = :access_period, \
cert = :cert, \
draft = :draft, \
updated_at = :updated_at',
expr_attr_names={
'#name': 'name',
},
@@ -86,6 +90,7 @@ def edit_course(course_id: str):
':name': course.name,
':cert': course.cert.model_dump(),
':access_period': course.access_period,
':draft': course.draft,
':updated_at': now_,
},
cond_expr='attribute_exists(sk)',