|
|
@ -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() |
|
|
|