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 != '':
fuelcost = float(fuelcost)
winter = request.form['winter']
if winter == 'TRUE':
winter = True
else:
winter = False
json_body = [
{
@ -54,7 +58,7 @@ def add_time():
"oilhealth": oilhealth,
"fuel": fuel,
"fuelcost": fuelcost,
"winter": bool(winter)
"winter": winter
}
}
]

View File

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