Change gitlab API to use oauth_token instead of PAT (PAT shuold work as well)

This commit is contained in:
Ori Kotek
2023-07-25 13:58:48 +03:00
parent adb3f17258
commit d23daf880f

View File

@ -14,7 +14,6 @@ from .git_provider import EDIT_TYPE, FilePatchInfo, GitProvider
class GitLabProvider(GitProvider): class GitLabProvider(GitProvider):
def __init__(self, merge_request_url: Optional[str] = None, incremental: Optional[bool] = False): def __init__(self, merge_request_url: Optional[str] = None, incremental: Optional[bool] = False):
gitlab_url = settings.get("GITLAB.URL", None) gitlab_url = settings.get("GITLAB.URL", None)
if not gitlab_url: if not gitlab_url:
@ -23,8 +22,8 @@ class GitLabProvider(GitProvider):
if not gitlab_access_token: if not gitlab_access_token:
raise ValueError("GitLab personal access token is not set in the config file") raise ValueError("GitLab personal access token is not set in the config file")
self.gl = gitlab.Gitlab( self.gl = gitlab.Gitlab(
gitlab_url, url=gitlab_url,
gitlab_access_token oauth_token=gitlab_access_token
) )
self.id_project = None self.id_project = None
self.id_mr = None self.id_mr = None