From 0e0b268adf7a27df7f03328705c4b6819112c51f Mon Sep 17 00:00:00 2001 From: Daniel Muckerman Date: Sat, 12 Dec 2020 23:10:39 -0500 Subject: [PATCH] Remove passwords from db --- accounts/auth/models.py | 4 +--- accounts/auth/views.py | 6 +----- accounts/templates/fragments/navbar.j2 | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/accounts/auth/models.py b/accounts/auth/models.py index b70e1c9..cf78890 100644 --- a/accounts/auth/models.py +++ b/accounts/auth/models.py @@ -19,12 +19,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): diff --git a/accounts/auth/views.py b/accounts/auth/views.py index 16ce24d..942be83 100644 --- a/accounts/auth/views.py +++ b/accounts/auth/views.py @@ -120,14 +120,10 @@ def login(): return redirect(url_for('auth.home')) 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) @@ -141,7 +137,7 @@ def login(): print(user) if user is None: - user = User(username, password) + user = User(username) db.session.add(user) user.authenticated = True db.session.commit() diff --git a/accounts/templates/fragments/navbar.j2 b/accounts/templates/fragments/navbar.j2 index 831b3ce..e29ee40 100644 --- a/accounts/templates/fragments/navbar.j2 +++ b/accounts/templates/fragments/navbar.j2 @@ -1,5 +1,5 @@