This commit is contained in:
Andros Fenollosa 2018-02-06 21:31:34 +01:00
parent 32209620e1
commit 9675dd0bf2

5
app.py
View File

@ -3,10 +3,10 @@
# ========================= # =========================
# Librarys # Librarys
# ========================= # =========================
from dotenv import load_dotenv, find_dotenv
import os import os
from flask import Flask, request from flask import Flask, request
from flask_restplus import Resource, Api from flask_restplus import Resource, Api
from dotenv import load_dotenv, find_dotenv
from models import db, User, Notice, Comment from models import db, User, Notice, Comment
from flask_marshmallow import Marshmallow from flask_marshmallow import Marshmallow
@ -196,7 +196,8 @@ class NewsSingle(Resource):
db.session.commit() db.session.commit()
except Exception as e: except Exception as e:
db.session.rollback() db.session.rollback()
return {'message': 'No se ha podido guardar la información'}, 500 return {
'message': 'No se ha podido guardar la información'}, 500
else: else:
return {'message': 'No existe la noticia'}, 400 return {'message': 'No existe la noticia'}, 400
return {'message': 'ok'}, 200 return {'message': 'ok'}, 200