summaryrefslogtreecommitdiff
path: root/gitlab.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2013-03-24 11:10:21 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2013-03-24 11:10:21 +0100
commitaf84700f1168ec13ca175b0eb9e64d6bd30df0a0 (patch)
treedd1e83f2d4a6671efcc49415bc2c67e0cfc71cb2 /gitlab.py
parent7631e5ef345e825a0cbb37660c785e6b30b85962 (diff)
downloadgitlab-af84700f1168ec13ca175b0eb9e64d6bd30df0a0.tar.gz
fix use of json() method from requests
Diffstat (limited to 'gitlab.py')
-rw-r--r--gitlab.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/gitlab.py b/gitlab.py
index 366673a..b28bd51 100644
--- a/gitlab.py
+++ b/gitlab.py
@@ -89,9 +89,9 @@ class Gitlab(object):
r = self.rawPost('/session',
{'email': self.email, 'password': self.password})
if r.status_code == 201:
- self.user = CurrentUser(self, r.json)
+ self.user = CurrentUser(self, r.json())
else:
- raise GitlabAuthenticationError(r.json['message'])
+ raise GitlabAuthenticationError(r.json()['message'])
self.private_token = self.user.private_token
@@ -157,7 +157,7 @@ class Gitlab(object):
cls = obj_class
if obj_class._returnClass:
cls = obj_class._returnClass
- l = [cls(self, item) for item in r.json]
+ l = [cls(self, item) for item in r.json()]
if kwargs:
for k, v in kwargs.items():
if k in ('page', 'per_page'):
@@ -166,7 +166,7 @@ class Gitlab(object):
obj.__dict__[k] = v
return l
elif r.status_code == 401:
- raise GitlabAuthenticationError(r.json['message'])
+ raise GitlabAuthenticationError(r.json()['message'])
else:
raise GitlabGetError('%d: %s' % (r.status_code, r.text))
@@ -192,9 +192,9 @@ class Gitlab(object):
"Can't connect to GitLab server (%s)" % self._url)
if r.status_code == 200:
- return r.json
+ return r.json()
elif r.status_code == 401:
- raise GitlabAuthenticationError(r.json['message'])
+ raise GitlabAuthenticationError(r.json()['message'])
else:
raise GitlabGetError('%d: %s' % (r.status_code, r.text))
@@ -212,7 +212,7 @@ class Gitlab(object):
if r.status_code == 200:
return True
elif r.status_code == 401:
- raise GitlabAuthenticationError(r.json['message'])
+ raise GitlabAuthenticationError(r.json()['message'])
return False
def create(self, obj):
@@ -228,9 +228,9 @@ class Gitlab(object):
"Can't connect to GitLab server (%s)" % self._url)
if r.status_code == 201:
- return r.json
+ return r.json()
elif r.status_code == 401:
- raise GitlabAuthenticationError(r.json['message'])
+ raise GitlabAuthenticationError(r.json()['message'])
else:
raise GitlabCreateError('%d: %s' % (r.status_code, r.text))
@@ -252,9 +252,9 @@ class Gitlab(object):
"Can't connect to GitLab server (%s)" % self._url)
if r.status_code == 200:
- return r.json
+ return r.json()
elif r.status_code == 401:
- raise GitlabAuthenticationError(r.json['message'])
+ raise GitlabAuthenticationError(r.json()['message'])
else:
raise GitlabUpdateError('%d: %s' % (r.status_code, r.text))