8000 Switch class used when creating a user · pythonthings/github3.py@ebc1705 · GitHub
[go: up one dir, main page]

Skip to content

Commit ebc1705

Browse files
Mark Troyeromgjlk
authored andcommitted
Switch class used when creating a user
create_user fails because the github3.users.User class expects data that is not present at the time of user creation. github3.users.ShortUser needs to be used instead.
1 parent 8f21f79 commit ebc1705

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

github3/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,12 +1748,12 @@ def create_user(self, login, email):
17481748
:param str login: (required), The user's username.
17491749
:param str email: (required), The user's email address.
17501750
1751-
:returns: :class:`User <github3.users.User>`, if successful
1751+
:returns: :class:`ShortUser <github3.users.ShortUser>`, if successful
17521752
"""
17531753
url = self._build_url('admin', 'users')
17541754
payload = {'login': login, 'email': email}
17551755
json_data = self._json(self._post(url, data=payload), 201)
1756-
return self._instance_or_null(users.User, json_data)
1756+
return self._instance_or_null(users.ShortUser, json_data)
17571757

17581758
@requires_auth
17591759
def admin_stats(self, option):

0 commit comments

Comments
 (0)
0