@@ -89,9 +89,9 @@ def credentials_auth(self):
89
89
r = self .rawPost ('/session' ,
90
90
{'email' : self .email , 'password' : self .password })
91
91
if r .status_code == 201 :
92
- self .user = CurrentUser (self , r .json )
92
+ self .user = CurrentUser (self , r .json () )
93
93
else :
94
- raise GitlabAuthenticationError (r .json ['message' ])
94
+ raise GitlabAuthenticationError (r .json () ['message' ])
95
95
96
96
self .private_token = self .user .private_token
97
97
@@ -157,7 +157,7 @@ def list(self, obj_class, **kwargs):
157
157
cls = obj_class
158
158
if obj_class ._returnClass :
159
159
cls = obj_class ._returnClass
160
- l = [cls (self , item ) for item in r .json ]
160
+ l = [cls (self , item ) for item in r .json () ]
161
161
if kwargs :
162
162
for k , v in kwargs .items ():
163
163
if k in ('page' , 'per_page' ):
@@ -166,7 +166,7 @@ def list(self, obj_class, **kwargs):
166
166
obj .__dict__ [k ] = v
167
167
return l
168
168
elif r .status_code == 401 :
169
- raise GitlabAuthenticationError (r .json ['message' ])
169
+ raise GitlabAuthenticationError (r .json () ['message' ])
170
170
else :
171
171
raise GitlabGetError ('%d: %s' % (r .status_code , r .text ))
172
172
@@ -192,9 +192,9 @@ def get(self, obj_class, id=None, **kwargs):
192
192
"Can't connect to GitLab server (%s)" % self ._url )
193
193
194
194
if r .status_code == 200 :
195
- return r .json
195
+ return r .json ()
196
196
elif r .status_code == 401 :
197
- raise GitlabAuthenticationError (r .json ['message' ])
197
+ raise GitlabAuthenticationError (r .json () ['message' ])
198
198
else :
199
199
raise GitlabGetError ('%d: %s' % (r .status_code , r .text ))
200
200
@@ -212,7 +212,7 @@ def delete(self, obj):
212
212
if r .status_code == 200 :
213
213
return True
214
214
elif r .status_code == 401 :
215
- raise GitlabAuthenticationError (r .json ['message' ])
215
+ raise GitlabAuthenticationError (r .json () ['message' ])
216
216
return False
217
217
218
218
def create (self , obj ):
@@ -228,9 +228,9 @@ def create(self, obj):
228
228
"Can't connect to GitLab server (%s)" % self ._url )
229
229
230
230
if r .status_code == 201 :
231
- return r .json
231
+ return r .json ()
232
232
elif r .status_code == 401 :
233
- raise GitlabAuthenticationError (r .json ['message' ])
233
+ raise GitlabAuthenticationError (r .json () ['message' ])
234
234
else :
235
235
raise GitlabCreateError ('%d: %s' % (r .status_code , r .text ))
236
236
@@ -252,9 +252,9 @@ def update(self, obj):
252
252
"Can't connect to GitLab server (%s)" % self ._url )
253
253
254
254
if r .status_code == 200 :
255
- return r .json
255
+ return r .json ()
256
256
elif r .status_code == 401 :
257
- raise GitlabAuthenticationError (r .json ['message' ])
257
+ raise GitlabAuthenticationError (r .json () ['message' ])
258
258
else :
259
259
raise GitlabUpdateError ('%d: %s' % (r .status_code , r .text ))
260
260
0 commit comments