|
@ -120,14 +120,10 @@ def login(): |
|
|
return redirect(url_for('auth.home')) |
|
|
return redirect(url_for('auth.home')) |
|
|
|
|
|
|
|
|
form = LoginForm(request.form) |
|
|
form = LoginForm(request.form) |
|
|
print(form) |
|
|
|
|
|
print(request.method) |
|
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST' and form.validate(): |
|
|
if request.method == 'POST' and form.validate(): |
|
|
username = request.form.get('username') |
|
|
username = request.form.get('username') |
|
|
password = request.form.get('password') |
|
|
password = request.form.get('password') |
|
|
print(username) |
|
|
|
|
|
print(password) |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
User.try_login(username, password) |
|
|
User.try_login(username, password) |
|
@ -141,7 +137,7 @@ def login(): |
|
|
|
|
|
|
|
|
print(user) |
|
|
print(user) |
|
|
if user is None: |
|
|
if user is None: |
|
|
user = User(username, password) |
|
|
|
|
|
|
|
|
user = User(username) |
|
|
db.session.add(user) |
|
|
db.session.add(user) |
|
|
user.authenticated = True |
|
|
user.authenticated = True |
|
|
db.session.commit() |
|
|
db.session.commit() |
|
|