@@ -114,9 +114,9 @@ def credentials_auth(self):
114
114
r = self .rawPost ('/session' ,
115
115
{'email' : self .email , 'password' : self .password })
116
116
if r .status_code == 201 :
117
- self .user = CurrentUser (self , r .json () )
117
+ self .user = CurrentUser (self , r .json )
118
118
else :
119
- raise GitlabAuthenticationError (r .json () ['message' ])
119
+ raise GitlabAuthenticationError (r .json ['message' ])
120
120
121
121
self .setToken (self .user .private_token )
122
122
@@ -208,7 +208,7 @@ def list(self, obj_class, **kwargs):
208
208
cls = obj_class
209
209
if obj_class ._returnClass :
210
210
cls = obj_class ._returnClass
211
- l = [cls (self , item ) for item in r .json () if item is not None ]
211
+ l = [cls (self , item ) for item in r .json if item is not None ]
212
212
if kwargs :
213
213
for k , v in kwargs .items ():
214
214
if k in ('page' , 'per_page' ):
@@ -217,7 +217,7 @@ def list(self, obj_class, **kwargs):
217
217
obj .__dict__ [k ] = str (v )
218
218
return l
219
219
elif r .status_code == 401 :
220
- raise GitlabAuthenticationError (r .json () ['message' ])
220
+ raise GitlabAuthenticationError (r .json ['message' ])
221
221
else :
222
222
raise GitlabGetError ('%d: %s' % (r .status_code , r .text ))
223
223
@@ -243,9 +243,9 @@ def get(self, obj_class, id=None, **kwargs):
243
243
"Can't connect to GitLab server (%s)" % self ._url )
244
244
245
245
if r .status_code == 200 :
246
- return r .json ()
246
+ return r .json
247
247
elif r .status_code == 401 :
248
- raise GitlabAuthenticationError (r .json () ['message' ])
248
+ raise GitlabAuthenticationError (r .json ['message' ])
249
249
elif r .status_code == 404 :
250
250
raise GitlabGetError ("Object doesn't exist" )
251
251
else :
@@ -266,9 +266,9 @@ def delete(self, obj):
266
266
if r .status_code == 200 :
267
267
return True
268
268
elif r .status_code == 401 :
269
- raise GitlabAuthenticationError (r .json () ['message' ])
269
+ raise GitlabAuthenticationError (r .json ['message' ])
270
270
else :
271
- raise GitlabDeleteError (r .json () ['message' ])
271
+ raise GitlabDeleteError (r .json ['message' ])
272
272
return False
273
273
274
274
def create (self , obj ):
@@ -292,9 +292,9 @@ def create(self, obj):
292
292
"Can't connect to GitLab server (%s)" % self ._url )
293
293
294
294
if r .status_code == 201 :
295
- return r .json ()
295
+ return r .json
296
296
elif r .status_code == 401 :
297
- raise GitlabAuthenticationError (r .json () ['message' ])
297
+ raise GitlabAuthenticationError (r .json ['message' ])
298
298
else :
299
299
raise GitlabCreateError ('%d: %s' % (r .status_code , r .text ))
300
300
@@ -319,9 +319,9 @@ def update(self, obj):
319
319
"Can't connect to GitLab server (%s)" % self ._url )
320
320
321
321
if r .status_code == 200 :
322
- return r .json ()
322
+ return r .json
323
323
elif r .status_code == 401 :
324
- raise GitlabAuthenticationError (r .json () ['message' ])
324
+ raise GitlabAuthenticationError (r .json ['message' ])
325
325
else :
326
326
raise GitlabUpdateError ('%d: %s' % (r .status_code , r .text ))
327
327
@@ -371,7 +371,7 @@ def _list_projects(self, url, **kwargs):
371
371
raise GitlabListError
372
372
373
373
l = []
374
- for o in r .json () :
374
+ for o in r .json :
375
375
l .append (Project (self , o ))
376
376
377
377
return l
@@ -745,7 +745,7 @@ def diff(self):
745
745
{'project_id' : self .project_id , 'commit_id' : self .id }
746
746
r = self .gitlab .rawGet (url )
747
747
if r .status_code == 200 :
748
- return r .json ()
748
+ return r .json
749
749
750
750
raise GitlabGetError
751
751
@@ -1013,7 +1013,7 @@ def tree(self, path='', ref_name=''):
1013
1013
url += '?path=%s&ref_name=%s' % (path , ref_name )
1014
1014
r = self .gitlab .rawGet (url )
1015
1015
if r .status_code == 200 :
1016
- return r .json ()
1016
+ return r .json
1017
1017
1018
1018
raise GitlabGetError
1019
1019
0 commit comments