diff --git a/apps/cic-notify/cic_notify/runnable/tasker.py b/apps/cic-notify/cic_notify/runnable/tasker.py index 453044f0..90417c7e 100644 --- a/apps/cic-notify/cic_notify/runnable/tasker.py +++ b/apps/cic-notify/cic_notify/runnable/tasker.py @@ -87,10 +87,18 @@ for key in config.store.keys(): module = importlib.import_module(config.store[key]) if key == 'TASKS_AFRICASTALKING': africastalking_notifier = module.AfricasTalkingNotifier + + api_sender_id = config.get('AFRICASTALKING_API_SENDER_ID') + logg.debug(f'SENDER ID VALUE IS: {api_sender_id}') + + if not api_sender_id: + api_sender_id = None + logg.debug(f'SENDER ID RESOLVED TO NONE: {api_sender_id}') + africastalking_notifier.initialize( config.get('AFRICASTALKING_API_USERNAME'), config.get('AFRICASTALKING_API_KEY'), - config.get('AFRICASTALKING_API_SENDER_ID') + api_sender_id ) diff --git a/apps/cic-ussd/cic_ussd/phone_number.py b/apps/cic-ussd/cic_ussd/phone_number.py index 34bd3655..7556709f 100644 --- a/apps/cic-ussd/cic_ussd/phone_number.py +++ b/apps/cic-ussd/cic_ussd/phone_number.py @@ -42,7 +42,7 @@ def get_user_by_phone_number(phone_number: str) -> Optional[Account]: :rtype: Account|None """ # consider adding region to user's metadata - phone_number = process_phone_number(phone_number=phone_number, region='KE') + phone_number = process_phone_number(phone_number=phone_number, region=E164Format.region) user = Account.session.query(Account).filter_by(phone_number=phone_number).first() return user