use marshmallow to persist memes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2022-02-13 21:43:12 +01:00
parent 4150471b75
commit ac459031c7

View File

@ -16,9 +16,7 @@ class MealBaseResource(Resource):
body = request.get_json()
try:
mealobj = self.mealschema.load(body)
db.session.add(mealobj.data)
db.session.commit()
self.mealschema.load(body, session=db.session)
return '', 204
except ValidationError as error:
abort(406, error.messages)