mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
fix: default user inserted before userId is created
moved application setup function calls before flask app creation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Prepares the server for use.
|
||||
"""
|
||||
|
||||
import uuid
|
||||
from app.db.sqlite.settings import load_settings
|
||||
from app.setup.files import create_config_dir
|
||||
@@ -14,6 +15,14 @@ from app.config import UserConfig
|
||||
|
||||
def run_setup():
|
||||
create_config_dir()
|
||||
|
||||
# setup config file
|
||||
config = UserConfig()
|
||||
config.setup_config_file()
|
||||
|
||||
if not config.userId:
|
||||
config.userId = str(uuid.uuid4())
|
||||
|
||||
setup_sqlite()
|
||||
run_migrations()
|
||||
|
||||
@@ -23,13 +32,6 @@ def run_setup():
|
||||
# settings table is empty
|
||||
pass
|
||||
|
||||
# setup config file
|
||||
config = UserConfig()
|
||||
config.setup_config_file()
|
||||
|
||||
if not config.userId:
|
||||
config.userId = str(uuid.uuid4())
|
||||
|
||||
instance_key = get_random_str()
|
||||
|
||||
# INFO: Load all tracks, albums, and artists into memory
|
||||
|
||||
Reference in New Issue
Block a user