Change python to actual booleans.

This commit is contained in:
Gogs 2017-04-09 18:36:01 -04:00
parent bc284e2514
commit 63b6d6944d
2 changed files with 8 additions and 4 deletions

View File

@ -44,6 +44,10 @@ def add_time():
if fuelcost != '': if fuelcost != '':
fuelcost = float(fuelcost) fuelcost = float(fuelcost)
winter = request.form['winter'] winter = request.form['winter']
if winter == 'TRUE':
winter = True
else:
winter = False
json_body = [ json_body = [
{ {
@ -54,7 +58,7 @@ def add_time():
"oilhealth": oilhealth, "oilhealth": oilhealth,
"fuel": fuel, "fuel": fuel,
"fuelcost": fuelcost, "fuelcost": fuelcost,
"winter": bool(winter) "winter": winter
} }
} }
] ]

View File

@ -47,9 +47,9 @@
<div class="row"> <div class="row">
<div class="col-xs-4"> <div class="col-xs-4">
<label for="winter">Winter Tires:</label> <label for="winter">Winter Tires:</label>
<select name="winter" class="form-control"> <select name="winter" class="form-control" default="false">
<option value="true">True</option> <option value="TRUE">True</option>
<option value="false">False</option> <option value="FALSE" selected>False</option>
</select> </select>
</div> </div>
</div><br> </div><br>