Adds ability to select language before creating account.

This commit is contained in:
philip 2021-12-29 17:10:25 +03:00
parent 7618abcda3
commit c2c7eb5e6d
Signed by untrusted user: mango-habanero
GPG Key ID: B00CE9034DA19FB7

View File

@ -171,7 +171,7 @@ class Account(SessionBase):
return check_password_hash(password, self.password_hash) return check_password_hash(password, self.password_hash)
def create(chain_str: str, phone_number: str, session: Session): def create(chain_str: str, phone_number: str, session: Session, preferred_language: str):
""" """
:param chain_str: :param chain_str:
:type chain_str: :type chain_str:
@ -179,12 +179,14 @@ def create(chain_str: str, phone_number: str, session: Session):
:type phone_number: :type phone_number:
:param session: :param session:
:type session: :type session:
:param preferred_language:
:type preferred_language:
:return: :return:
:rtype: :rtype:
""" """
api = Api(callback_task='cic_ussd.tasks.callback_handler.account_creation_callback', api = Api(callback_task='cic_ussd.tasks.callback_handler.account_creation_callback',
callback_queue='cic-ussd', callback_queue='cic-ussd',
callback_param='', callback_param=preferred_language,
chain_str=chain_str) chain_str=chain_str)
task_uuid = api.create_account().id task_uuid = api.create_account().id
TaskTracker.add(session=session, task_uuid=task_uuid) TaskTracker.add(session=session, task_uuid=task_uuid)