Fixing database error
This commit is contained in:
parent
46ce8655f3
commit
9aa573384b
4 changed files with 13 additions and 8 deletions
|
@ -1,2 +1,2 @@
|
|||
venv
|
||||
src/database.py
|
||||
src/database.db
|
||||
|
|
|
@ -75,6 +75,11 @@ db.init_app(app)
|
|||
# Initializes CORS so that the api_tool can talk to the example app
|
||||
cors.init_app(app)
|
||||
|
||||
# create database
|
||||
# Add users for the example
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
db.session.commit()
|
||||
|
||||
@app.route('/api/login', methods=['POST'])
|
||||
def login():
|
||||
|
@ -106,7 +111,6 @@ def refresh():
|
|||
$ curl http://localhost:5000/api/refresh -X GET \
|
||||
-H "Authorization: Bearer <your_token>"
|
||||
"""
|
||||
print("refresh request")
|
||||
old_token = request.get_data()
|
||||
new_token = guard.refresh_jwt_token(old_token)
|
||||
ret = {'access_token': new_token}
|
||||
|
@ -215,7 +219,6 @@ def survey():
|
|||
user_db.education = education
|
||||
user_db.skills = skills
|
||||
db.session.commit()
|
||||
print(req)
|
||||
ret = {'message': 'Vielen Dank für das Ausfüllen der Umfrage.'}
|
||||
return ret, 200
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue