This commit is contained in:
parent
88bbeded0f
commit
d539472905
@ -17,6 +17,7 @@ class MealBaseResource(Resource):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.mealschema.load(body, session=db.session)
|
self.mealschema.load(body, session=db.session)
|
||||||
|
db.session.commit()
|
||||||
return '', 204
|
return '', 204
|
||||||
except ValidationError as error:
|
except ValidationError as error:
|
||||||
abort(406, error.messages)
|
abort(406, error.messages)
|
||||||
|
@ -6,7 +6,6 @@ from .ingredientschema import IngredientSchema
|
|||||||
|
|
||||||
class MealSchema(ma.SQLAlchemyAutoSchema):
|
class MealSchema(ma.SQLAlchemyAutoSchema):
|
||||||
|
|
||||||
# A list of author objects
|
|
||||||
ingredients = ma.Nested(IngredientSchema, many=True)
|
ingredients = ma.Nested(IngredientSchema, many=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Loading…
Reference in New Issue
Block a user