Merge branch 'development' into 'master'

Development

Fixes:
 * wrong date preselected when creation a pitstop
 * creation of new vehicle

See merge request !26
This commit is contained in:
Joachim Lusiardi 2016-07-29 21:50:52 +02:00
commit adf51c85f2
2 changed files with 3 additions and 1 deletions

View File

@ -187,6 +187,8 @@ def create_vehicle():
if form.consumables.data: if form.consumables.data:
form.consumables.default = form.consumables.data form.consumables.default = form.consumables.data
else:
form.consumables.default = []
if form.validate_on_submit(): if form.validate_on_submit():
if len(form.consumables.data) == 0: if len(form.consumables.data) == 0:

View File

@ -82,7 +82,7 @@ class CreatePitstopForm(Form):
if self.date.data: if self.date.data:
self.date.default = self.date.data self.date.default = self.date.data
else: else:
self.date.default = self.last_pitstop.date self.date.default = date.today()
if self.odometer.data: if self.odometer.data:
self.odometer.default = self.odometer.data self.odometer.default = self.odometer.data
else: else: