コード例 #1
0
ファイル: routes.py プロジェクト: hackerclub/skidctf
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)
コード例 #2
0
ファイル: routes.py プロジェクト: hackerclub/minictf
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)
コード例 #3
0
ファイル: forms.py プロジェクト: hackerclub/minictf
def is_correct(form, field):
    if not pw_check.validate(field.data):
        raise ValidationError('Wrong password!')
コード例 #4
0
def is_correct(form, field):
    if not pw_check.validate(field.data):
        raise ValidationError('Wrong password!')