Added filename check
This commit is contained in:
parent
2ca194c28f
commit
88f61f9bdb
1 changed files with 2 additions and 0 deletions
|
|
@ -48,6 +48,8 @@ class OntologyService:
|
||||||
async def upload_ontology(
|
async def upload_ontology(
|
||||||
self, ontology_key: str, file: UploadFile, user, description: Optional[str] = None
|
self, ontology_key: str, file: UploadFile, user, description: Optional[str] = None
|
||||||
) -> OntologyMetadata:
|
) -> OntologyMetadata:
|
||||||
|
if not file.filename:
|
||||||
|
raise ValueError("File must have a filename")
|
||||||
if not file.filename.lower().endswith(".owl"):
|
if not file.filename.lower().endswith(".owl"):
|
||||||
raise ValueError("File must be in .owl format")
|
raise ValueError("File must be in .owl format")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue