@@ -358,7 +358,7 @@ def create_repository(self, name, description='', homepage='',
358
358
if int (team_id ) > 0 :
359
359
data .update ({'team_id' : team_id })
360
360
json = self ._json (self ._post (url , data ), 201 )
361
- return Repository ( json , self ) if json else None
361
+ return self . _instance_or_null ( Repository , json )
362
362
363
363
@requires_auth
364
364
def conceal_member (self , username ):
@@ -394,7 +394,7 @@ def create_team(self, name, repo_names=[], permission=''):
394
394
'permission' : permission }
395
395
url = self ._build_url ('teams' , base_url = self ._api )
396
396
json = self ._json (self ._post (url , data ), 201 )
397
- return Team ( json , self ) if json else None
397
+ return self . _instance_or_null ( Team , json )
398
398
399
399
@requires_auth
400
400
def edit (self , billing_email = None , company = None , email = None , location = None ,
@@ -552,7 +552,7 @@ def team(self, team_id):
552
552
if int (team_id ) > 0 :
553
553
url = self ._build_url ('teams' , str (team_id ))
554
554
json = self ._json (self ._get (url ), 200 )
555
- return Team ( json , self ) if json else None
555
+ return self . _instance_or_null ( Team , json )
556
556
557
557
558
558
class Membership (GitHubCore ):
0 commit comments