8000 Make Memberships more consistent · helenst/github3.py@7c4f8d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c4f8d9

Browse files
committed
Make Memberships more consistent
1 parent f3e2b6b commit 7c4f8d9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

github3/orgs.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,6 @@ class Membership(GitHubCore):
559559

560560
"""The wrapper for information about Team and Organization memberships."""
561561

562-
def __init__(self, membership, session=None):
563-
super(Membership, self).__init__(membership, session)
564-
self._update_attributes(membership)
565-
566562
def _repr(self):
567563
return '<Membership [{0}]>'.format(self.organization)
568564

@@ -581,10 +577,12 @@ def edit(self, state):
581577
582578
:param str state: (required), the state the membership should be in.
583579
Only accepts ``"active"``.
584-
:returns: itself
580+
:returns: whether the edit was successful or not
581+
:rtype: bool
585582
"""
586583
if state and state.lower() == 'active':
587584
data = dumps({'state': state.lower()})
588585
json = self._json(self._patch(self._api, data=data))
589586
self._update_attributes(json)
590-
return self
587+
return True
588+
return False

0 commit comments

Comments
 (0)
0