File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -523,9 +523,10 @@ def db_backup_and_create_new():
523523 _bkp_name = "ceopardy_{}_{}.db" .format (
524524 datetime .now ().strftime ("%Y-%m-%d_%H%M" ), previous_roundfile
525525 )
526- # SQLite URI is resolved against app.instance_path; the live file lives there too.
527- db_path = os .path .join (app .instance_path , config ["DATABASE_FILENAME" ])
528- bkp_path = os .path .join (app .instance_path , _bkp_name )
526+ # The live DB and its backups sit next to the user's data/ directory
527+ # (matches SQLALCHEMY_DATABASE_URI in ceopardy/__init__.py).
528+ db_path = os .path .join (config ["BASE_DIR" ], config ["DATABASE_FILENAME" ])
529+ bkp_path = os .path .join (config ["BASE_DIR" ], _bkp_name )
529530 app .logger .info ("Backing up current game to {}" .format (bkp_path ))
530531 db .session .remove ()
531532 db .engine .dispose ()
You can’t perform that action at this time.
0 commit comments