Merge branch 'philip/notify-sender-id-resolution' into 'master'
Handle empty string defaults in kubernetes secrets. See merge request grassrootseconomics/cic-internal-integration!183
This commit is contained in:
commit
4f41c5bacf
@ -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
|
||||
)
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user