mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-30 18:50:58 +00:00
Do not return an error if an image has already been uploaded
This commit is contained in:
parent
644e659729
commit
38df4bea2e
@ -149,8 +149,10 @@ 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")
|
||||
|
||||
if await images_repo.get_image(image_path):
|
||||
raise ControllerBadRequestError(f"Image '{image_path}' already exists")
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user