Esempio n. 1
0
def login():
  form = LoginForm()

  if request.method == 'POST':
    if form.validate() == False:
      flash('Please enter a valid password.')
      return render_template('login.html', form=form)
    if pw_check.validate(form.password.data):
      return render_template('login.html', success=True)
    else:
      flash('Invalid password!')
      return render_template('login.html', form=form)

  elif request.method == 'GET':
    return render_template('login.html', form=form)
Esempio n. 2
0
def login():
  form = LoginForm()

  if request.method == 'POST':
    if form.validate() == False:
      flash('Please enter a valid password.')
      return render_template('login.html', form=form)
    if pw_check.validate(form.password.data):
      return render_template('login.html', success=True)
    else:
      flash('Invalid password!')
      return render_template('login.html', form=form)

  elif request.method == 'GET':
    return render_template('login.html', form=form)
Esempio n. 3
0
def is_correct(form, field):
    if not pw_check.validate(field.data):
        raise ValidationError('Wrong password!')
Esempio n. 4
0
def is_correct(form, field):
    if not pw_check.validate(field.data):
        raise ValidationError('Wrong password!')