use marshmallow to persist memes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4150471b75
commit
ac459031c7
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user