fix(settings): prevent redundant DB move during setup
Some checks are pending
Docker / build (push) Waiting to run
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:
parent
9d99063846
commit
ef2875d81f
1 changed files with 1 additions and 1 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue