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:
@@ -17,8 +17,8 @@ def add() -> str:
|
||||
|
||||
return render_template(
|
||||
'add.html',
|
||||
path=current_app.config['SOCKET_PATH'].value,
|
||||
namespace=current_app.config['SOCKET_NAMESPACE'].value,
|
||||
path=current_app.config['SOCKET_PATH'],
|
||||
namespace=current_app.config['SOCKET_NAMESPACE'],
|
||||
messages=MESSAGES
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ def bulk() -> str:
|
||||
|
||||
return render_template(
|
||||
'bulk.html',
|
||||
path=current_app.config['SOCKET_PATH'].value,
|
||||
namespace=current_app.config['SOCKET_NAMESPACE'].value,
|
||||
path=current_app.config['SOCKET_PATH'],
|
||||
namespace=current_app.config['SOCKET_NAMESPACE'],
|
||||
messages=MESSAGES
|
||||
)
|
||||
|
||||
@@ -160,19 +160,19 @@ def do_delete_database() -> Response:
|
||||
def download_database() -> Response:
|
||||
# Create a file name with a timestamp embedded
|
||||
name, extension = os.path.splitext(
|
||||
os.path.basename(current_app.config['DATABASE_PATH'].value)
|
||||
os.path.basename(current_app.config['DATABASE_PATH'])
|
||||
)
|
||||
|
||||
# Info
|
||||
logger.info('The database has been downloaded')
|
||||
|
||||
return send_file(
|
||||
current_app.config['DATABASE_PATH'].value,
|
||||
current_app.config['DATABASE_PATH'],
|
||||
as_attachment=True,
|
||||
download_name='{name}-{timestamp}{extension}'.format(
|
||||
name=name,
|
||||
timestamp=datetime.now().astimezone(g.timezone).strftime(
|
||||
current_app.config['DATABASE_TIMESTAMP_FORMAT'].value
|
||||
current_app.config['DATABASE_TIMESTAMP_FORMAT']
|
||||
),
|
||||
extension=extension
|
||||
)
|
||||
|
||||
@@ -114,7 +114,7 @@ def do_upload() -> Response:
|
||||
file = upload_helper(
|
||||
'file',
|
||||
'instructions.upload',
|
||||
extensions=current_app.config['INSTRUCTIONS_ALLOWED_EXTENSIONS'].value,
|
||||
extensions=current_app.config['INSTRUCTIONS_ALLOWED_EXTENSIONS'],
|
||||
)
|
||||
|
||||
if isinstance(file, Response):
|
||||
|
||||
Reference in New Issue
Block a user