MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / upload_cancellation

Function upload_cancellation

src/opencdeserver/api/app/api/documents.py:358–375  ·  view source on GitHub ↗
(upload_session: str, current_user: User = Depends(get_current_active_user))

Source from the content-addressed store, hash-verified

356
357@router.post("/documents/1.0/upload-cancellation", tags=[""], status_code=status.HTTP_204_NO_CONTENT)
358def upload_cancellation(upload_session: str, current_user: User = Depends(get_current_active_user)):
359
360 try:
361 # remove session and leaf nodes from database
362 document = doc_db.get_upload_cancellation(upload_session, current_user)
363
364 # clean temp dir
365 document_name = doc_db.safe_path(document.document_id)
366 path = "./data/document_parts/" + document_name + "/"
367 shutil.rmtree(path)
368
369 except Exception as e:
370 print(e)
371
372 finally:
373 print("Upload cancellation complete.")
374
375 return
376
377
378# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----

Callers

nothing calls this directly

Calls 3

printFunction · 0.85
safe_pathMethod · 0.80

Tested by

no test coverage detected