add draft
This commit is contained in:
@@ -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)',
|
||||
|
||||
Reference in New Issue
Block a user