mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: make some courses inputs optional
This commit is contained in:
parent
8ad2533058
commit
513d65704f
8 changed files with 40 additions and 15 deletions
|
|
@ -31,8 +31,8 @@ async def api_create_course(
|
|||
name: str = Form(),
|
||||
description: str = Form(),
|
||||
public: bool = Form(),
|
||||
learnings: str = Form(),
|
||||
tags: str = Form(),
|
||||
learnings: str = Form(None),
|
||||
tags: str = Form(None),
|
||||
about: str = Form(),
|
||||
current_user: PublicUser = Depends(get_current_user),
|
||||
db_session: Session = Depends(get_db_session),
|
||||
|
|
|
|||
|
|
@ -146,6 +146,9 @@ async def create_course(
|
|||
)
|
||||
course.thumbnail_image = name_in_disk
|
||||
|
||||
else:
|
||||
course.thumbnail_image = ""
|
||||
|
||||
# Insert course
|
||||
db_session.add(course)
|
||||
db_session.commit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue