Fixing database error #154

Merged
cami merged 1 commit from bugfix/databaseerror into main 2021-07-13 22:47:38 +00:00
4 changed files with 13 additions and 8 deletions
Showing only changes of commit 9aa573384b - Show all commits

View file

@ -1,2 +1,2 @@
venv
src/database.py
src/database.db

View file

@ -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:

View file

@ -1,13 +1,13 @@
version: '3.7'
services:
frontend_bt:
frontend-prod:
image: caminsha/bt-frontend
container_name: frontend-prod
ports:
- 3000:3000
- 3000:80
backend-prod:
image: caminsha/bt-backend
container_name: frontend-prod
container_name: backend-prod
environment:
DEBUG: "no"
PORT: 5000

View file

@ -1,4 +1,6 @@
podman stop frontend-{dev,prod} backend-{dev,prod}
podman rmi caminsha/bt-{frontend,backend}
podman stop frontend-dev frontend-prod frontend-testing backend-dev backend-prod backend-testing
podman rm frontend-dev frontend-prod frontend-testing backend-dev backend-prod backend-testing
podman rmi {frontend,backend}-testing
podman rmi caminsha/bt-frontend caminsha/bt-backend
podman-compose down
podman-compose -f docker-compose.prod.yml down