diff --git a/events/ticketEventHandler.py b/events/ticketEventHandler.py index ed8f15a..3913456 100644 --- a/events/ticketEventHandler.py +++ b/events/ticketEventHandler.py @@ -624,13 +624,15 @@ async def add_contributor(self, issue): else: angel_mentor = markdown_contents.get("Mentor(s)") - url = f'https://api.github.com/users/{angel_mentor}' - async with aiohttp.ClientSession() as session: - async with session.get(url) as response: - angel_mentor_data = await response.json() - if angel_mentor_data: - angel_mentor_id = angel_mentor_data["id"] - angel_mentor_detials = await self.postgres_client.get_data("github_id","contributors_registration", angel_mentor_id) + angel_mentor_detials = [] + if angel_mentor: + url = f'https://api.github.com/users/{angel_mentor}' + async with aiohttp.ClientSession() as session: + async with session.get(url) as response: + angel_mentor_data = await response.json() + if angel_mentor_data: + angel_mentor_id = angel_mentor_data["id"] + angel_mentor_detials = await self.postgres_client.get_data("github_id","contributors_registration", angel_mentor_id) mentor_data = { "issue_id": get_issue[0]["id"],