Cors + Tests

This commit is contained in:
Yûki VACHOT 2022-01-14 01:27:18 +01:00
parent 5f590b2cb0
commit a398b49a98
4 changed files with 5 additions and 9 deletions

View file

@ -1,7 +1,6 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import sys
import os
db = SQLAlchemy()
@ -23,13 +22,9 @@ def create_app(flask_env='development'):
else:
print('ENV Variables passed : ', app.config['SQLALCHEMY_BINDS'])
print('init_app')
db.init_app(app)
with app.app_context():
#print('import routes')
from . import routes
app.register_blueprint(routes.bp)
#print('db.create_all')
db.create_all()
#print('db created')
return app

View file

@ -32,7 +32,7 @@ def login():
elif res['status'] == 1:
user = None
token = create_auth_token(user)
return send_error(404, res['message'], token)
return send_error(400, res['message'], token)
else:
return send_error(400, 'Empty email and/or password fields.')
except KeyError as e: