From d3558fdb332d0bfd8bf97fa6f301868347968cb6 Mon Sep 17 00:00:00 2001 From: arkohut <39525455+arkohut@users.noreply.github.com> Date: Sat, 8 Jun 2024 13:56:08 +0800 Subject: [PATCH] fix: tolerant no write permission for copy favicon to static dir --- backend/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/config.py b/backend/config.py index dd3bc9e4b..2a6665b17 100644 --- a/backend/config.py +++ b/backend/config.py @@ -306,7 +306,10 @@ STATIC_DIR = Path(os.getenv("STATIC_DIR", BACKEND_DIR / "static")).resolve() frontend_favicon = FRONTEND_BUILD_DIR / "favicon.png" if frontend_favicon.exists(): - shutil.copyfile(frontend_favicon, STATIC_DIR / "favicon.png") + try: + shutil.copyfile(frontend_favicon, STATIC_DIR / "favicon.png") + except PermissionError: + logging.error(f"No write permission to {STATIC_DIR / 'favicon.png'}") else: logging.warning(f"Frontend favicon not found at {frontend_favicon}")