From 0c245453e59b3d15e9f473bfb3c93e921bf53ec0 Mon Sep 17 00:00:00 2001 From: VarMonke Date: Thu, 5 May 2022 13:30:25 +0530 Subject: [PATCH] Add some stuff --- github/objects.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/github/objects.py b/github/objects.py index 7586c3c..9d2fcb2 100644 --- a/github/objects.py +++ b/github/objects.py @@ -80,6 +80,11 @@ class _BaseUser(APIObject): results = await self._http.get_user_orgs(self) # type: ignore return [Organization(data, self._http) for data in results] + @property + def name(self): + """Optional[str]: The name of the user, if available.""" + return self._response.get('login') + class User(_BaseUser): """Representation of a user object on Github. @@ -125,6 +130,7 @@ class User(_BaseUser): return f'<{self.__class__.__name__} login: {self.login!r}, id: {self.id}, created_at: {self.created_at}>' + class PartialUser(_BaseUser): __slots__ = ( 'site_admin',