def get_integration_user(bot: str, account: int): if not Utility.is_exist(User, query={ "bot": bot, "is_integration_user": True }, raise_error=False): email = bot + "@integration.com" password = Utility.generate_password() return AccountProcessor.add_user(email=email, password=password, first_name=bot, last_name=bot, account=account, bot=bot, user="******", is_integration_user=True) else: return User.objects(bot=bot).get( is_integration_user=True).to_mongo().to_dict()
def get_integration_user(bot: str, account: int): """ Getting the integration user. If it does'nt exist, a new integration user is created """ if not Utility.is_exist( User, raise_error=False, bot=bot, is_integration_user=True, status=True ): email = bot + "@integration.com" password = Utility.generate_password() return AccountProcessor.add_user( email=email, password=password, first_name=bot, last_name=bot, account=account, bot=bot, user="******", is_integration_user=True, ) else: return ( User.objects(bot=bot).get(is_integration_user=True).to_mongo().to_dict() )