Compare commits
6 Commits
Kilian
...
a9338805e2
| Author | SHA1 | Date | |
|---|---|---|---|
| a9338805e2 | |||
| 7f82a288da | |||
| 8728d3028b | |||
| bc7e1591bd | |||
| 673b671ab8 | |||
| 578b2c15d8 |
@@ -6,7 +6,7 @@ from .checks import *
|
||||
|
||||
|
||||
class CreateServiceForm(FlaskForm):
|
||||
date = DateField('Date of Pitstop')
|
||||
date = DateField('Date of Service')
|
||||
odometer = IntegerField('Odometer (km)', validators=[odometer_date_check])
|
||||
costs = DecimalField('Costs (€, overall)', places=2, validators=[costs_check])
|
||||
description = TextAreaField('Description', validators=[Length(1, 4096)])
|
||||
@@ -72,4 +72,4 @@ class EditServiceForm(FlaskForm):
|
||||
'litres': 'Litres must be higher than 0.01 L.',
|
||||
'costs': 'Costs must be higher than 0.01 €.'
|
||||
}
|
||||
return messages
|
||||
return messages
|
||||
|
||||
@@ -14,6 +14,7 @@ from ..tools import (
|
||||
db_log_delete,
|
||||
get_event_line_for_vehicle,
|
||||
get_latest_pitstop_for_vehicle,
|
||||
get_users_active_vehicle,
|
||||
)
|
||||
from .. import app, db
|
||||
|
||||
|
||||
@@ -204,7 +204,9 @@ def compute_lower_limits_for_new_pitstop(
|
||||
|
||||
|
||||
def pitstop_service_key(x):
|
||||
return x.date, x.odometer
|
||||
# if the entry got no odometer (regular costs!) then we assume it's okay
|
||||
# to have regular cost at a virtual odometer of 0 on that day.
|
||||
return x.date, x.odometer or 0
|
||||
|
||||
|
||||
def get_event_line_for_vehicle(vehicle):
|
||||
|
||||
@@ -41,8 +41,8 @@ class TestingConfig(Config):
|
||||
|
||||
|
||||
class ProductionConfig(Config):
|
||||
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:{h}@database/pitstops'.format(
|
||||
h=os.environ.get('DATABASE_ENV_MYSQL_ROOT_PASSWORD'))
|
||||
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://pitstops:{h}@localhost/pitstops'.format(
|
||||
h=os.environ.get('MYSQL_PASSWORD'))
|
||||
|
||||
|
||||
config = {
|
||||
|
||||
@@ -7,3 +7,4 @@ markdown
|
||||
Flask-Limiter
|
||||
requests
|
||||
email_validator
|
||||
gunicorn
|
||||
Reference in New Issue
Block a user