From cf64387d81f092834ef610a8778dacdf12bccbee Mon Sep 17 00:00:00 2001 From: PhilipWafula Date: Wed, 22 Sep 2021 11:10:33 +0300 Subject: [PATCH] Refactors to avoid conversion of zero values to wei. --- apps/cic-ussd/cic_ussd/tasks/notifications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/cic-ussd/cic_ussd/tasks/notifications.py b/apps/cic-ussd/cic_ussd/tasks/notifications.py index e28f1567..8cab098e 100644 --- a/apps/cic-ussd/cic_ussd/tasks/notifications.py +++ b/apps/cic-ussd/cic_ussd/tasks/notifications.py @@ -24,7 +24,8 @@ def transaction(notification_data: dict): :rtype: """ role = notification_data.get('role') - amount = from_wei(notification_data.get('token_value')) + token_value = notification_data.get('token_value') + amount = token_value if token_value == 0 else from_wei(token_value) balance = notification_data.get('available_balance') phone_number = notification_data.get('phone_number') preferred_language = notification_data.get('preferred_language')