Add explicit variable types

This commit is contained in:
Gogs 2017-01-28 02:09:09 -05:00
parent 23085de24e
commit 98d2c082ee
2 changed files with 5 additions and 6 deletions

View File

@ -1,4 +1,4 @@
from flask import Flask, request, render_template
from flask import Flask, request, render_template, redirect, url_for
app = Flask(__name__)
from influxdb import InfluxDBClient
@ -16,7 +16,7 @@ def success():
def main_page():
return render_template('index.html')
@app.route('/add_time', methods=['POST'])
@app.route('/add_time', methods=['POST', 'GET'])
def add_time():
# database = request.form['db']
# table = request.form['table']
@ -33,11 +33,11 @@ def add_time():
"time": date + "T" + time + "Z",
"measurement": "odyssey",
"fields": {
"odometer": odometer,
"odometer": float(odometer),
"oilhealth": oilhealth,
"fuel": fuel,
"fuelcost": fuelcost,
"winter": winter
"winter": bool(winter)
}
}
]
@ -49,7 +49,7 @@ def add_time():
return render_template('index.html')
return redirect(url_for('main_page'))
@app.route('/admin')
def admin_index():

View File

@ -6,7 +6,6 @@ influxdb==4.0.0
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
pkg-resources==0.0.0
python-dateutil==2.6.0
pytz==2016.10
requests==2.12.4