mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Allow an image to be uploaded to the controller again even if it is already in the database
This commit is contained in:
2 files changed
+10
-5
No files matched your search
@@ -148,11 +148,6 @@ async def upload_image(
|
||||
if os.path.commonprefix([base_images_directory, full_path]) != base_images_directory:
|
||||
raise ControllerForbiddenError(f"Cannot write image, '{image_path}' is forbidden")
|
||||
|
||||
image = await images_repo.get_image(image_path)
|
||||
if image:
|
||||
log.warning(f"Image '{image_path}' already exists")
|
||||
return image
|
||||
|
||||
try:
|
||||
allow_raw_image = Config.instance().settings.Server.allow_raw_images
|
||||
image = await write_image(image_path, full_path, request.stream(), images_repo, allow_raw_image=allow_raw_image)
|
||||
|
||||
Reference in new issue
Block a user