diff --git a/backend/trip/utils/utils.py b/backend/trip/utils/utils.py index 61c9c80..f0dc72e 100644 --- a/backend/trip/utils/utils.py +++ b/backend/trip/utils/utils.py @@ -34,7 +34,10 @@ def b64img_decode(data: str) -> bytes: def remove_image(path: str): try: - Path(assets_folder_path() / path).unlink() + fpath = Path(assets_folder_path() / path) + if not fpath.exists(): + return + fpath.unlink() except OSError as exc: raise Exception("Error deleting image:", exc, path)