全局中文化
This commit is contained in:
@@ -13,11 +13,11 @@ async def create_item(db: AsyncSession, item_in: FaqCreate, *, created_by: uuid.
|
||||
# ensure category exists and matches study scope
|
||||
category = await db.get(FaqCategory, item_in.category_id)
|
||||
if not category:
|
||||
raise ValueError("Category not found")
|
||||
raise ValueError("分类不存在")
|
||||
if category.study_id != item_in.study_id:
|
||||
# allow global category if item is global (None) or project if matches
|
||||
if not (category.study_id is None and item_in.study_id is None):
|
||||
raise ValueError("Category scope mismatch")
|
||||
raise ValueError("分类范围不匹配")
|
||||
|
||||
item = FaqItem(
|
||||
study_id=item_in.study_id,
|
||||
|
||||
Reference in New Issue
Block a user