Allow an image to be uploaded to the controller again even if it is already in the database

This commit is contained in:
grossmj committed 2025-04-17 19:07:22 +07:00
1 parent 0826b9c259
commit aa8ccf4f82
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)