mirror of
https://github.com/kennethreitz-archive/github2.git
synced 2026-06-05 23:50:18 +00:00
Connect to the Github API anonymously if username and api_token are None.
This commit is contained in:
+5
-2
@@ -37,8 +37,11 @@ class GithubRequest(object):
|
||||
}
|
||||
|
||||
def encode_authentication_data(self, extra_post_data):
|
||||
post_data = {"login": self.username,
|
||||
"token": self.api_token}
|
||||
if self.username and self.api_token:
|
||||
post_data = {"login": self.username,
|
||||
"token": self.api_token}
|
||||
else:
|
||||
post_data = {}
|
||||
post_data.update(extra_post_data)
|
||||
return urlencode(post_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user