Skip to content

Commit f5e860a

Browse files
committed
Merge pull request pyapi-gitlab#17 from sag47/newfeature-autodetect-gitlab
Back to classic behavior.
2 parents 2ec0ba5 + b5fa407 commit f5e860a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitlab/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class Gitlab(object):
14-
def __init__(self, host, token="", version=5):
14+
def __init__(self, host, token=""):
1515
if token != "":
1616
self.token = token
1717
self.headers = {"PRIVATE-TOKEN": self.token}
@@ -20,7 +20,6 @@ def __init__(self, host, token="", version=5):
2020
self.users_url = self.host + "/api/v3/users"
2121
self.keys_url = self.host + "/api/v3/user/keys"
2222
self.groups_url = self.host + "/api/v3/groups"
23-
self.version = version
2423

2524
def login(self, email, password):
2625
data = {"email": email, "password": password}
@@ -273,8 +272,9 @@ def createProject(self, name, description="", default_branch="",
273272

274273
# if gitlab is the new 6th version, there is a public option for the
275274
# project creation
276-
if self.version == 6:
275+
if len(public) > 0:
277276
data['public'] = public
277+
#request now works with both GitLab 5 and GitLab 6.
278278
request = requests.post(self.projects_url, headers=self.headers,
279279
data=data)
280280
if request.status_code == 201:

0 commit comments

Comments
 (0)