Пример #1
0
def login():
    form = TellerLoginForm(request.form)
    if form.validate_on_submit():
        account = Account.get_or_none((Account.account_number == form.account_number.data) & (Account.deleted == False))

        if account and check_password_hash(account.pin, form.password.data):
            session['atm_auth'] = account.id

            return redirect(url_for('teller.index'))
        else:
            flash('Invalid Account Number and PIN')
    return render_template('teller/login.html', form=form)
Пример #2
0
def validate_account_number(form, field):
    if not Account.get_or_none((Account.account_number == field.data)
                               & (Account.deleted == False)):
        raise ValidationError('Account is inactivate or does not exists')
Пример #3
0
def validate_time_deposit(form, field):
    if not Account.get_or_none((Account.account_number == field.data)
                               & (Account.type == 3)):
        raise ValidationError('Account is not a time deposit account')
Пример #4
0
def validate_receiver_account(form, field):
    if not Account.get_or_none((Account.account_number == field.data)
                               & (Account.type <= 2)):
        raise ValidationError('Account is a time deposit account')
Пример #5
0
def validate_time_deposit(form, field):
    if not Account.get_or_none((Account.account_number == field.data)
                               & (Account.time_deposit == 0)):
        raise ValidationError(
            'Account is currently holding an existing time deposit')