8000 Merge branch 'pr/308' into develop · helenst/github3.py@942a5ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 942a5ae

Browse files
committed
Merge branch 'pr/308' into develop
2 parents 293a2c5 + 608efaa commit 942a5ae

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

github3/notifications.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def set_subscription(self, subscribed, ignored):
9090
url = self._build_url('subscription', base_url=self._api)
9191
sub = {'subscribed': subscribed, 'ignored': ignored}
9292
json = self._json(self._put(url, data=dumps(sub)), 200)
93-
return Subscription(json, self) if json else None
93+
return self._instance_or_null(Subscription, json)
9494

9595
def subscription(self):
9696
"""Checks the status of the user's subscription to this thread.
@@ -99,7 +99,7 @@ def subscription(self):
9999
"""
100100
url = self._build_url('subscription', base_url=self._api)
101101
json = self._json(self._get(url), 200)
102-
return Subscription(json, self) if json else None
102+
return self._instance_or_null(Subscription, json)
103103

104104

105105
class Subscription(GitHubCore):

github3/orgs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def create_repository(self, name, description='', homepage='',
358358
if int(team_id) > 0:
359359
data.update({'team_id': team_id})
360360
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)
362362

363363
@requires_auth
364364
def conceal_member(self, username):
@@ -394,7 +394,7 @@ def create_team(self, name, repo_names=[], permission=''):
394394
'permission': permission}
395395
url = self._build_url('teams', base_url=self._api)
396396
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)
398398

399399
@requires_auth
400400
def edit(self, billing_email=None, company=None, email=None, location=None,
@@ -552,7 +552,7 @@ def team(self, team_id):
552552
if int(team_id) > 0:
553553
url = self._build_url('teams', str(team_id))
554554
json = self._json(self._get(url), 200)
555-
return Team(json, self) if json else None
555+
return self._instance_or_null(Team, json)
556556

557557

558558
class Membership(GitHubCore):

0 commit comments

Comments
 (0)
0