6 Commits

Author SHA1 Message Date
a9338805e2 add wsgi stuff 2021-12-21 18:22:00 +00:00
7f82a288da update db conf in production 2021-12-21 16:23:15 +00:00
8728d3028b update db conf in production 2021-12-21 16:21:00 +00:00
bc7e1591bd fix sorting for regular costs 2021-06-23 08:29:35 +02:00
673b671ab8 fix date of service 2021-06-22 21:49:32 +02:00
578b2c15d8 bugfix: could not create service 2021-06-22 21:39:49 +02:00
5 changed files with 9 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ from .checks import *
class CreateServiceForm(FlaskForm): class CreateServiceForm(FlaskForm):
date = DateField('Date of Pitstop') date = DateField('Date of Service')
odometer = IntegerField('Odometer (km)', validators=[odometer_date_check]) odometer = IntegerField('Odometer (km)', validators=[odometer_date_check])
costs = DecimalField('Costs (€, overall)', places=2, validators=[costs_check]) costs = DecimalField('Costs (€, overall)', places=2, validators=[costs_check])
description = TextAreaField('Description', validators=[Length(1, 4096)]) description = TextAreaField('Description', validators=[Length(1, 4096)])
@@ -72,4 +72,4 @@ class EditServiceForm(FlaskForm):
'litres': 'Litres must be higher than 0.01 L.', 'litres': 'Litres must be higher than 0.01 L.',
'costs': 'Costs must be higher than 0.01 €.' 'costs': 'Costs must be higher than 0.01 €.'
} }
return messages return messages

View File

@@ -14,6 +14,7 @@ from ..tools import (
db_log_delete, db_log_delete,
get_event_line_for_vehicle, get_event_line_for_vehicle,
get_latest_pitstop_for_vehicle, get_latest_pitstop_for_vehicle,
get_users_active_vehicle,
) )
from .. import app, db from .. import app, db

View File

@@ -204,7 +204,9 @@ def compute_lower_limits_for_new_pitstop(
def pitstop_service_key(x): 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): def get_event_line_for_vehicle(vehicle):

View File

@@ -41,8 +41,8 @@ class TestingConfig(Config):
class ProductionConfig(Config): class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:{h}@database/pitstops'.format( SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://pitstops:{h}@localhost/pitstops'.format(
h=os.environ.get('DATABASE_ENV_MYSQL_ROOT_PASSWORD')) h=os.environ.get('MYSQL_PASSWORD'))
config = { config = {

View File

@@ -7,3 +7,4 @@ markdown
Flask-Limiter Flask-Limiter
requests requests
email_validator email_validator
gunicorn