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):
|
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)])
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ markdown
|
|||||||
Flask-Limiter
|
Flask-Limiter
|
||||||
requests
|
requests
|
||||||
email_validator
|
email_validator
|
||||||
|
gunicorn
|
||||||
Reference in New Issue
Block a user