diff --git a/app/main.py b/app/main.py index 88a435f..2ed0409 100644 --- a/app/main.py +++ b/app/main.py @@ -139,12 +139,11 @@ class CreatePitstopForm(Form): def create_pit_stop_form(): last_pitstop = Pitstop.query.order_by(Pitstop.id.desc()).first() if last_pitstop is None: - last_pitstop = Pitstop(0, 0, datetime.now()) + last_pitstop = Pitstop(0, 0, date.today()) form = CreatePitstopForm() form.set_pitstop(last_pitstop) if form.validate_on_submit(): - new_stop = Pitstop(form.odometer.data, form.litres.data, form.date.data) sqldb.session.add(new_stop) sqldb.session.commit() @@ -153,7 +152,7 @@ def create_pit_stop_form(): # dynamically set values form.odometer.default = last_pitstop.odometer form.litres.default = last_pitstop.litres - form.date.default = datetime.now() + form.date.default = date.today() form.process() return render_template('newPitStopForm.html', form=form)