Don't store complex objects in Flash config that could mask existing config items, rather store the values and handle the actual list of conf differently

This commit is contained in:
2025-01-20 15:20:07 +01:00
parent 3712356caa
commit e232e2ab7f
37 changed files with 126 additions and 118 deletions

View File

@@ -37,7 +37,7 @@ class BrickSQL(object):
logger.debug('SQLite3: connect')
self.connection = sqlite3.connect(
current_app.config['DATABASE_PATH'].value
current_app.config['DATABASE_PATH']
)
# Setup the row factory to get pseudo-dicts rather than tuples
@@ -249,7 +249,7 @@ class BrickSQL(object):
# Delete the database
@staticmethod
def delete() -> None:
os.remove(current_app.config['DATABASE_PATH'].value)
os.remove(current_app.config['DATABASE_PATH'])
# Info
logger.info('The database has been deleted')
@@ -292,7 +292,7 @@ class BrickSQL(object):
# Replace the database with a new file
@staticmethod
def upload(file: FileStorage, /) -> None:
file.save(current_app.config['DATABASE_PATH'].value)
file.save(current_app.config['DATABASE_PATH'])
# Info
logger.info('The database has been imported using file {file}'.format(