From e5a6075baf1f45883e580b58f7a89213044f59c8 Mon Sep 17 00:00:00 2001 From: Daniel Muckerman Date: Sat, 12 Dec 2020 23:10:49 -0500 Subject: [PATCH] Remove passwords from db --- app.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 9377bf0..4fc765b 100644 --- a/app.py +++ b/app.py @@ -99,12 +99,10 @@ class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(100)) - password = db.Column(db.String(128)) authenticated = db.Column(db.Boolean, default=False) - def __init__(self, username, password): + def __init__(self, username): self.username = username - self.password = password @staticmethod def try_login(username, password): @@ -199,14 +197,10 @@ def login(): return redirect(url_for('index')) form = LoginForm(request.form) - print(form) - print(request.method) if request.method == 'POST' and form.validate(): username = request.form.get('username') password = request.form.get('password') - print(username) - print(password) try: User.try_login(username, password) @@ -218,9 +212,8 @@ def login(): user = User.query.filter(User.username == username).first() - print(user) if user is None: - user = User(username, password) + user = User(username) db.session.add(user) user.authenticated = True db.session.commit()