fix(settings): prevent redundant DB move during setup
Some checks are pending
Docker / build (push) Waiting to run

Ensures database move only occurs if the target does not exist, preventing unnecessary overwrites and potential data loss.
This commit is contained in:
Kumi 2024-11-12 14:25:33 +01:00
parent 9d99063846
commit ef2875d81f
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -98,7 +98,7 @@ WSGI_APPLICATION = "moneropro.wsgi.application"
# Handle old, questionable database location.
opt_path = Path("/opt/db.sqlite3")
if opt_path.exists():
if opt_path.exists() and not (BASE_DIR / "db.sqlite3").exists():
shutil.move(opt_path, BASE_DIR / "db.sqlite3")
DATABASES = {