fix(fork_flow): fix _UserUrl function

This commit is contained in:
江畅
2020-08-25 13:22:59 +08:00
parent eca7ced6c8
commit d5c24f3364
+6 -1
View File
@@ -1497,7 +1497,12 @@ class Project(object):
# print("remote.url: %s doesn't belong to gitee" % self.remote.url)
raise PullRequestError("remote.url: %s doesn't belong to gitee" % self.remote.url)
def _UserUrl(self, token):
def _UserUrl(self):
token = self.manifest.manifestProject.config.GetString('repo.token')
if not token:
token = GitConfig.ForUser().GetString('repo.token')
if not token:
raise UploadError('repo.token is None, Please set it, you need `repo config -h`')
gitee_url = 'https://gitee.com/api/v5/user'
payload = {'access_token': token}
r = requests.get(gitee_url, json=payload)