Bug fixes discovered from smoke tests.
This commit is contained in:
parent
fad9b62539
commit
f53e9a7d2a
@ -71,7 +71,7 @@ def process_exit_insufficient_balance(display_key: str, user: User, ussd_session
|
|||||||
operational_balance = get_cached_operational_balance(blockchain_address=user.blockchain_address)
|
operational_balance = get_cached_operational_balance(blockchain_address=user.blockchain_address)
|
||||||
|
|
||||||
# compile response data
|
# compile response data
|
||||||
user_input = ussd_session.get('user_input').split('*')[-1]
|
user_input = ussd_session.get('session_data').get('transaction_amount')
|
||||||
transaction_amount = to_wei(value=int(user_input))
|
transaction_amount = to_wei(value=int(user_input))
|
||||||
token_symbol = 'SRF'
|
token_symbol = 'SRF'
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ def process_exit_insufficient_balance(display_key: str, user: User, ussd_session
|
|||||||
amount=from_wei(transaction_amount),
|
amount=from_wei(transaction_amount),
|
||||||
token_symbol=token_symbol,
|
token_symbol=token_symbol,
|
||||||
recipient_information=tx_recipient_information,
|
recipient_information=tx_recipient_information,
|
||||||
token_balance=operational_balance
|
token_balance=operational_balance,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -401,7 +401,11 @@ def process_request(user_input: str, user: User, ussd_session: Optional[dict] =
|
|||||||
'exit_invalid_pin',
|
'exit_invalid_pin',
|
||||||
'exit_invalid_new_pin',
|
'exit_invalid_new_pin',
|
||||||
'exit_pin_mismatch',
|
'exit_pin_mismatch',
|
||||||
'exit_invalid_request'
|
'exit_invalid_request',
|
||||||
|
"exit_insufficient_balance",
|
||||||
|
"exit_successful_transaction",
|
||||||
|
"help",
|
||||||
|
"complete"
|
||||||
] and person_metadata is not None:
|
] and person_metadata is not None:
|
||||||
return UssdMenu.find_by_name(name='start')
|
return UssdMenu.find_by_name(name='start')
|
||||||
else:
|
else:
|
||||||
|
@ -45,7 +45,15 @@ def is_authorized_pin(state_machine_data: Tuple[str, dict, User]) -> bool:
|
|||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
user_input, ussd_session, user = state_machine_data
|
user_input, ussd_session, user = state_machine_data
|
||||||
return user.verify_password(password=user_input)
|
pin_validity = user.verify_password(password=user_input)
|
||||||
|
if pin_validity is True:
|
||||||
|
return user.verify_password(password=user_input)
|
||||||
|
else:
|
||||||
|
# bump number for failed attempts
|
||||||
|
user.failed_pin_attempts += 1
|
||||||
|
Account.session.add(user)
|
||||||
|
Account.session.commit()
|
||||||
|
return pin_validity
|
||||||
|
|
||||||
|
|
||||||
def is_locked_account(state_machine_data: Tuple[str, dict, User]) -> bool:
|
def is_locked_account(state_machine_data: Tuple[str, dict, User]) -> bool:
|
||||||
|
@ -154,8 +154,8 @@ en:
|
|||||||
00. Back
|
00. Back
|
||||||
99. Exit
|
99. Exit
|
||||||
exit_insufficient_balance: |-
|
exit_insufficient_balance: |-
|
||||||
CON Payment of %{amount} %{token_symbol} to %{recipient_information} has failed due to insufficent balance.
|
CON Payment of %{amount} %{token_symbol} to %{recipient_information} has failed due to insufficient balance.
|
||||||
Your Sarafu-Network balances is: %{token_balance}
|
Your Sarafu-Network balances is: %{token_balance} %{token_symbol}
|
||||||
00. Back
|
00. Back
|
||||||
99. Exit
|
99. Exit
|
||||||
help: |-
|
help: |-
|
||||||
|
@ -155,7 +155,7 @@ sw:
|
|||||||
99. Ondoka
|
99. Ondoka
|
||||||
exit_insufficient_balance: |-
|
exit_insufficient_balance: |-
|
||||||
CON Malipo ya %{amount} %{token_symbol} kwa %{recipient_information} halijakamilika kwa sababu salio lako haitoshi.
|
CON Malipo ya %{amount} %{token_symbol} kwa %{recipient_information} halijakamilika kwa sababu salio lako haitoshi.
|
||||||
Akaunti yako ya Sarafu-Network ina salio ifuatayo: %{token_balance}
|
Akaunti yako ya Sarafu-Network ina salio ifuatayo: %{token_balance} %{token_symbol}
|
||||||
00. Nyuma
|
00. Nyuma
|
||||||
99. Ondoka
|
99. Ondoka
|
||||||
help: |-
|
help: |-
|
||||||
|
Loading…
Reference in New Issue
Block a user