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() body = request.get_json()
try: try:
mealobj = self.mealschema.load(body) self.mealschema.load(body, session=db.session)
db.session.add(mealobj.data)
db.session.commit()
return '', 204 return '', 204
except ValidationError as error: except ValidationError as error:
abort(406, error.messages) abort(406, error.messages)