register_validator = Validator()
    if register_validator.validate_generic_name(full_name,6,15) == False:
        error_message = register_validator.message
    elif register_validator.validate_login_name(login_name,6,15) == False:
        error_message = register_validator.message
    elif register_validator.validate_login_key(login_key,6,12) == False:
        error_message = register_validator.message
    elif login_key != login_key_confirm:
        error_message = "<P>Passwords do not match!</p>"
    elif int(account_number)<10000 or int(account_number) > 999999:
        error_message = "<P>Account number must be greater than 10000 and less than 999999!</p>"
    elif register_validator.validate_bank_name(bank_name,3,10) == False:
        error_message = register_validator.message
    elif register_validator.validate_branch_name(branch_name,5,10) == False:
        error_message = register_validator.message
    elif register_validator.validate_ifsc_code(ifsc_code) == False:
        error_message = register_validator.message

mlog.error(TAG,"Register validator error message: " + str(error_message))
if error_message != None:
    print('''
        <p>Failed to register:</p>
        <div id="entry" >
    ''')
    print(error_message)
    print('''
        </div>
        <div id="entry" >
            <a href="show_register.py">Register</a>
        </div>
        <div id="entry" >
示例#2
0
error_message = None
if (payee_name == None or payee_account == None or payee_bank == None
        or payee_branch == None) or payee_ifsc_code == None:
    error_message = "<br><p>Failed to add payee! Invalid attributes provided. Add payee again with valid attributes</p>"
else:
    payee_validator = Validator()
    if payee_validator.validate_generic_name(payee_name, 6, 15) == False:
        error_message = payee_validator.message
    elif int(payee_account) < 10000 or int(payee_account) > 999999:
        error_message = "<P>Account number must be greater than 10000 and less than 999999!</p>"
    elif payee_validator.validate_bank_name(payee_bank, 3, 10) == False:
        error_message = payee_validator.message
    elif payee_validator.validate_branch_name(payee_branch, 5, 10) == False:
        error_message = payee_validator.message
    elif payee_validator.validate_ifsc_code(payee_ifsc_code) == False:
        error_message = payee_validator.message

mlog.error(TAG, "Add payee validator error message: " + str(error_message))
if error_message != None:
    print('''
        <div id="entry" >        
            <p>Failed to add payee:</p>
            <div id="entry" >
    ''')
    print(error_message)
    print('''</div></div>''')
    print(helperHTML.get_html_end_preset())
    sys.exit()

try:
示例#3
0
        or beneficiery_ifsc_code == None or transfer_amount == None):
    error_message = "<br><p>Failed to do money transfer! Invalid attributes provided. Try to transfer again with valid attributes</p>"
else:
    transfer_validator = Validator()
    if transfer_validator.validate_generic_name(beneficiery_name, 4,
                                                15) == False:
        error_message = transfer_validator.message
    elif int(beneficiery_account) < 10000 or int(beneficiery_account) > 999999:
        error_message = "<P>Beneficiary Account number must be greater than 10000 and less than 999999!</p>"
    elif transfer_validator.validate_bank_name(beneficiery_bank, 3,
                                               10) == False:
        error_message = transfer_validator.message
    elif transfer_validator.validate_branch_name(beneficiery_branch, 4,
                                                 10) == False:
        error_message = transfer_validator.message
    elif transfer_validator.validate_ifsc_code(beneficiery_ifsc_code) == False:
        error_message = transfer_validator.message
    elif int(transfer_amount) < 0 or int(transfer_amount) > 100000:
        error_message = "<P>Transfer amount must be greater than 0 and less than 100000!</p>"

mlog.error(TAG,
           "Money transfer validator error message: " + str(error_message))
if error_message != None:
    print('''
        <div id="entry" >        
            <p>Failed to do money transfer:</p>
            <div id="entry" >
    ''')
    print(error_message)
    print('''</div></div>''')
    print(helperHTML.get_html_end_preset())