diff --git a/Github/main.py b/Github/main.py index cc95d51..0af4470 100644 --- a/Github/main.py +++ b/Github/main.py @@ -80,7 +80,7 @@ class GHClient: return User(await http.get_user(self.session, username), self.session) async def get_repo(self, owner: str, repo_name: str) -> Repository: - """Fetch aGithub repository from it's name.""" + """Fetch a Github repository from it's name.""" return Repository(await http.get_repo_from_name(self.session, owner, repo_name), self.session) async def get_org(self, org_name: str) -> Organization: diff --git a/Github/objects/repo.py b/Github/objects/repo.py index c4acd34..f951d89 100644 --- a/Github/objects/repo.py +++ b/Github/objects/repo.py @@ -28,7 +28,7 @@ class Repository(APIOBJECT): 'stargazers_count', 'watchers_count', 'forks', - 'license' + 'license', ) def __init__(self, response: dict, session: aiohttp.ClientSession) -> None: super().__init__(response, session) @@ -47,12 +47,15 @@ class Repository(APIOBJECT): setattr(self, key, dt_formatter(value)) continue + if 'license' in key and value is None: + setattr(self, key, None) + else: setattr(self, key, value) continue def __repr__(self) -> str: - return f'' + return f'' @classmethod async def from_name(cls, session: aiohttp.ClientSession,owner: str, repo_name: str) -> 'Repository':