Raising error when attempting to move a mounted file.

This commit is contained in:
Roland 2024-03-10 16:47:31 -06:00
parent a486a39b73
commit 2dbcccfc9d
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -217,6 +217,8 @@ async def post_move(_: Request, body: schema.Move):
for source in sources:
if not source.exists():
raise FileNotFoundError(f'Cannot find {source} to move')
if source.is_mount():
raise FileConflict(f'Cannot move mounted directory!')
try:
await lib.move(destination, *sources)