diff --git a/website/__init__.py b/website/__init__.py index 8d24a3dd..9a815450 100644 --- a/website/__init__.py +++ b/website/__init__.py @@ -36,6 +36,7 @@ def load_user(id): def create_database(app): - if not path.exists('website/' + DB_NAME): - db.create_all(app=app) - print('Created Database!') + if not os.path.exists('website/' + DB_NAME): + with app.app_context(): + db.create_all() + print("Created Database!") diff --git a/website/auth.py b/website/auth.py index 8c65752e..3c9747d3 100644 --- a/website/auth.py +++ b/website/auth.py @@ -12,7 +12,7 @@ def login(): if request.method == 'POST': email = request.form.get('email') - password = request.form.get('password') + password = request.form.get('password1') user = User.query.filter_by(email=email).first() if user: