print error messages
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2022-02-13 21:25:37 +01:00
parent 62e03c7ce3
commit 8a482b83e9
2 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ class Meal(db.Model):
description = db.Column(db.Text, nullable=False) description = db.Column(db.Text, nullable=False)
kcal = db.Column(db.Integer, nullable=True) kcal = db.Column(db.Integer, nullable=True)
price = db.Column(db.Integer, nullable=True) price = db.Column(db.Integer, nullable=True)
spicy = db.Column(db.Boolean, nullable=False, default=False) spicy = db.Column(db.Boolean, nullable=True, default=False)
vegan = db.Column(db.Boolean, nullable=False, default=False) vegan = db.Column(db.Boolean, nullable=True, default=False)
glutenfree = db.Column(db.Boolean, nullable=False, default=False) glutenfree = db.Column(db.Boolean, nullable=True, default=False)
ingredients = db.relationship('Ingredient', backref='Meal', lazy='dynamic') ingredients = db.relationship('Ingredient', backref='Meal', lazy='dynamic')

View File

@ -20,8 +20,8 @@ class MealBaseResource(Resource):
db.session.add(mealobj.data) db.session.add(mealobj.data)
db.session.commit() db.session.commit()
return '', 204 return '', 204
except ValidationError: except ValidationError as error:
abort(406, "meal validation error") abort(406, error.messages)
def get(self): def get(self):
meals = Meal.query.all() meals = Meal.query.all()