access config from current_app object

blueprint_refactoring
Simon Pirkelmann 2022-01-27 23:57:06 +01:00
parent b3c585bd27
commit b64b0c7bb6
1 changed files with 2 additions and 2 deletions

View File

@ -258,13 +258,13 @@ def list_tokens():
def token_log():
log = []
try:
with open(config.nfc_log) as f:
with open(current_app.config['NFC_LOG']) as f:
log += f.readlines()
log.reverse()
log = [l.split(' - ') for l in log]
return render_template('token_log.html', log=log)
except Exception as e:
flash(f"NFC logfile {Path(config.nfc_log).absolute()} konnte nicht gelesen werden. Exception: {e}")
flash(f"NFC logfile {Path(current_app.config['NFC_LOG']).absolute()} konnte nicht gelesen werden. Exception: {e}")
return redirect('/')
# routes for registering, editing and deleting tokens