I wanna run different js script, when something is true and something is false. If something is True, it runs, but if it's anything else, "else" does not make. Do you know why?
Code from login.py
class Login():
def checkVal(email, password):
if db.wowband.find({"email":email, "password":password}).count() == 1:
return True
else:
return False
Code from wow.py (default script)
def hello_world():
loginForm = LoginForm()
if request.method == "POST" and loginForm.validate():
logRes = Login.checkVal(loginForm.email.data, loginForm.password.data)
print(logRes)
return render_template('index.html', loginForm=loginForm, registrationForm=registrationForm, logRes=logRes)
return render_template('index.html', loginForm=loginForm, registrationForm=registrationForm)
Code from forms.py
class LoginForm(Form):
email = EmailField('email', [validators.Email(), validators.DataRequired()])
password = PasswordField('password')
login = SubmitField('login')
And code from html file with conditions
Aucun commentaire:
Enregistrer un commentaire