Skip to content

Commit 0bb3732

Browse files
committed
Fixed github name != username issue
1 parent bd7927c commit 0bb3732

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

git_repo/services/ext/github.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def __init__(self, *args, **kwarg):
2121
def connect(self):
2222
try:
2323
self.gh.login(token=self._privatekey)
24-
self.username = self.gh.user().name
25-
self.username = self.gh.user().name
24+
self.username = self.gh.user().login
2625
except github3.models.GitHubError as err:
2726
if err.code is 401:
2827
if not self._privatekey:
@@ -81,7 +80,7 @@ def _format_gist(self, gist):
8180

8281
def gist_list(self, gist=None):
8382
if not gist:
84-
for gist in self.gh.iter_gists(self.gh.user().name):
83+
for gist in self.gh.iter_gists(self.gh.user().login):
8584
yield (gist.html_url, gist.description)
8685
else:
8786
gist = self.gh.gist(self._format_gist(gist))
@@ -208,5 +207,5 @@ def get_auth_token(cls, login, password):
208207

209208
@property
210209
def user(self):
211-
return self.gh.user().name
210+
return self.gh.user().login
212211

0 commit comments

Comments
 (0)