Commit e3afb47c authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

tested log and fixed download_csv

parent 0be78ca3
[2020-06-10 17:46:11,097] INFO in __init__: loading views
[2020-06-10 17:48:13,702] INFO in __init__: loading views
[2020-06-10 17:48:32,080] WARNING in __init__: loading views
[2020-06-10 19:17:46,564] INFO in views: Logged out user admin
[2020-06-10 19:18:00,168] INFO in views: Logged in user admin
[2020-06-10 19:18:19,269] INFO in views: User admin created new application - test
[2020-06-10 19:18:47,866] INFO in views: User admin added new device dev1 test for application 0513d8d9
[2020-06-10 19:19:21,955] INFO in views: User admin created alert 7d6c9e - dev1 test.a > 0 for application 0513d8d9
[2020-06-10 19:19:32,734] INFO in views: User admin deleted alert 7d6c9e for application 0513d8d9
[2020-06-10 19:20:04,752] INFO in views: User admin created automation 14f87d - IF dev1 test.a > 0 THEN dev1 test.confID_1 = 1 for application 0513d8d9
[2020-06-10 19:20:12,716] INFO in views: User admin deleted automation 14f87d for application 0513d8d9
[2020-06-10 19:20:35,490] INFO in views: User admin deleted device 1 for application 0513d8d9
[2020-06-10 19:22:26,286] INFO in views: User admin deleted config messsage AQIxAA== for application 0513d8d9 device 1
[2020-06-10 19:26:21,369] INFO in views: User admin downloaded data for application 0513d8d9 device 1
[2020-06-10 19:26:44,083] INFO in views: User admin deleted for application 0513d8d9 device 1
[2020-06-10 19:26:58,457] INFO in views: User admin deleted application - 0513d8d9
from app import app, mail
from flask_mail import Message
from flask import render_template, request, redirect, url_for, session, send_from_directory, flash
from flask import render_template, request, redirect, url_for, session, send_from_directory, flash, after_this_request
import psycopg2
import app.dao.user.user as ud
......@@ -293,7 +293,7 @@ def application_device_configuration(appkey, devid):
flash('Failed to enqueue message: {}'.format(res[1]), 'danger')
redirect(url_for('application_device_settings', appkey=appkey, devid=devid))
else:
app.logger.info('User %s deleted device %s for application %s', session['name'], devid, appkey)
app.logger.info('User %s enqueued config message %s for the app %s device %s', session['name'], base64_args, appkey, devid)
flash('Message enqueued', 'success')
return '', 201
......@@ -321,7 +321,8 @@ def application_device_download_csv(appkey, devid):
with open(app.config['DATA_DOWNLOAD_DIR_OS']+'/'+fn, 'w+') as f:
f.write('utc,timestamp,')
for d in dumpd[1][0][2]:
print(dev)
for d in dev[3]['format']:
f.write(d)
f.write(',')
f.write('\n')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment