fix(knowledge API): Unique Constraint Issue with create_space API Cau… (#1794)

Co-authored-by: aries_ckt <916701291@qq.com>
This commit is contained in:
Wei Zhang 2024-08-09 11:03:59 +08:00 committed by GitHub
parent c30670b4c9
commit 621c5a391c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,7 +123,10 @@ class Service(BaseService[KnowledgeSpaceEntity, SpaceServeRequest, SpaceServeRes
Returns:
SpaceServeResponse: The response
"""
space = self.get(request)
query = {
"name": request.name
}
space = self.get(query)
if space is not None:
raise HTTPException(
status_code=400,