From d53947290574e131b53aad1f168caba92ce95c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 13 Feb 2022 21:48:03 +0100 Subject: [PATCH] commit session --- mealapi/resources/mealresource.py | 1 + mealapi/schemas/mealschema.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/mealapi/resources/mealresource.py b/mealapi/resources/mealresource.py index ac3c7ff..1918818 100644 --- a/mealapi/resources/mealresource.py +++ b/mealapi/resources/mealresource.py @@ -17,6 +17,7 @@ class MealBaseResource(Resource): try: self.mealschema.load(body, session=db.session) + db.session.commit() return '', 204 except ValidationError as error: abort(406, error.messages) diff --git a/mealapi/schemas/mealschema.py b/mealapi/schemas/mealschema.py index 0849a7b..41f56b8 100644 --- a/mealapi/schemas/mealschema.py +++ b/mealapi/schemas/mealschema.py @@ -6,7 +6,6 @@ from .ingredientschema import IngredientSchema class MealSchema(ma.SQLAlchemyAutoSchema): - # A list of author objects ingredients = ma.Nested(IngredientSchema, many=True) class Meta: