10000 Update handling for gists and milestones · vikasmulaje/github3.py@571eccc · GitHub
[go: up one dir, main page]

Skip to content

Commit 571eccc

Browse files
committed
Update handling for gists and milestones
1 parent bb8cbaf commit 571eccc

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

github3/issues/milestone.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
from __future__ import unicode_literals
33

44
from json import dumps
5+
6+
from .. import users
7+
58
from ..decorators import requires_auth
69
from .label import Label
710
from ..models import GitHubCore
8-
from ..users import User
911

1012

1113
class Milestone(GitHubCore):
@@ -31,7 +33,9 @@ def _update_attributes(self, milestone):
3133

3234
#: :class:`User <github3.users.User>` object representing the creator
3335
#: of the milestone.
34-
self.creator = self._class_attribute(milestone, 'creator', User, self)
36+
self.creator = self._class_attribute(
37+
milestone, 'creator', users.ShortUser, self
38+
)
3539

3640
#: Number of issues associated with this milestone which are still
3741
#: open.

github3/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def _update_attributes(self, user):
186186
#: Repostories URL (not a template)
187187
self.repos_url = user['repos_url']
188188

189-
self.site_admin = user['site_admin']
189+
self.site_admin = user.get('site_admin')
190190

191191
#: Starred URL Template. Expands with ``owner`` and ``repo``
192192
self.starred_urlt = URITemplate(user['starred_url'])
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"http_interactions": [{"request": {"body": "{\"files\": {\"filename.py\": {\"content\": \"#content\"}}, \"description\": \"Gist Title\", \"public\": true}", "headers": {"Content-Length": "96", "Accept-Encoding": "gzip, deflate, compress", "Accept": "application/vnd.github.v3.full+json", "User-Agent": "github3.py/0.7.0", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "token <AUTH_TOKEN>"}, "method": "POST", "uri": "https://api.github.com/gists"}, "response": {"body": {"string": "{\"url\":\"https://api.github.com/gists/6647085\",\"forks_url\":\"https://api.github.com/gists/6647085/forks\",\"commits_url\":\"https://api.github.com/gists/6647085/commits\",\"id\":\"6647085\",\"git_pull_url\":\"https://gist.github.com/6647085.git\",\"git_push_url\":\"https://gist.github.com/6647085.git\",\"html_url\":\"https://gist.github.com/6647085\",\"files\":{\"filename.py\":{\"filename\":\"filename.py\",\"type\":\"application/python\",\"language\":\"Python\",\"raw_url\":\"https://gist.github.com/raw/6647085/dc60090e8af1ccb3fb2151390b56d02ca8c2623c/filename.py\",\"size\":8,\"content\":\"#content\"}},\"public\":true,\"created_at\":\"2013-09-21T03:58:34Z\",\"updated_at\":\"2013-09-21T03:58:34Z\",\"description\":\"Gist Title\",\"comments\":0,\"user\":null,\"comments_url\":\"https://api.github.com/gists/6647085/comments\",\"owner\":{\"login\":\"sigmavirus24\",\"id\":240830,\"avatar_url\":\"https://0.gravatar.com/avatar/c148356d89f925e692178bee1d93acf7?d=https%3A%2F%2Fidenticons.github.com%2F4a71764034cdae877484be72718ba526.png\",\"gravatar_id\":\"c148356d89f925e692178bee1d93acf7\",\"url\":\"https://api.github.com/users/sigmavirus24\",\"html_url\":\"https://github.com/sigmavirus24\",\"followers_url\":\"https://api.github.com/users/sigmavirus24/followers\",\"following_url\":\"https://api.github.com/users/sigmavirus24/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/sigmavirus24/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/sigmavirus24/subscriptions\",\"organizations_url\":\"https://api.github.com/users/sigmavirus24/orgs\",\"repos_url\":\"https://api.github.com/users/sigmavirus24/repos\",\"events_url\":\"https://api.github.com/users/sigmavirus24/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/sigmavirus24/received_events\",\"type\":\"User\"},\"forks\":[],\"history\":[{\"user\":{\"login\":\"sigmavirus24\",\"id\":240830,\"avatar_url\":\"https://0.gravatar.com/avatar/c148356d89f925e692178bee1d93acf7?d=https%3A%2F%2Fidenticons.github.com%2F4a71764034cdae877484be72718ba526.png\",\"gravatar_id\":\"c148356d89f925e692178bee1d93acf7\",\"url\":\"https://api.github.com/users/sigmavirus24\",\"html_url\":\"https://github.com/sigmavirus24\",\"followers_url\":\"https://api.github.com/users/sigmavirus24/followers\",\"following_url\":\"https://api.github.com/users/sigmavirus24/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/sigmavirus24/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/sigmavirus24/subscriptions\",\"organizations_url\":\"https://api.github.com/users/sigmavirus24/orgs\",\"repos_url\":\"https://api.github.com/users/sigmavirus24/repos\",\"events_url\":\"https://api.github.com/users/sigmavirus24/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/sigmavirus24/received_events\",\"type\":\"User\"},\"version\":\"e9d920a6876c042a66080031d78b0136c9094bcd\",\"committed_at\":\"2013-09-21T03:58:35Z\",\"change_status\":{\"total\":1,\"additions\":1,\"deletions\":0},\"url\":\"https://api.github.com/gists/6647085/e9d920a6876c042a66080031d78b0136c9094bcd\"}]}", "encoding": "utf-8"}, "headers": {"status": "201 Created", "x-accepted-oauth-scopes": "gist", "x-ratelimit-remaining": "4997", "x-github-media-type": "github.v3; param=full; format=json", "x-content-type-options": "nosniff", "access-control-expose-headers": "ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes", "x-github-request-id": "427075EF:1C3D:542194:523D196A", "cache-control": "private, max-age=60, s-maxage=60", "vary": "Accept, Authorization, Cookie", "content-length": "3076", "server": "GitHub.com", "x-ratelimit-limit": "5000", "location": "https://api.github.com/gists/6647085", "access-control-allow-credentials": "true", "date": "Sat, 21 Sep 2013 03:58:35 GMT", "x-oauth-scopes": "user, repo, gist", "content-type": "application/json; charset=utf-8", "access-control-allow-origin": "*", "etag": "\"e1dff8c07e741534482f279ed77f0b4e\"", "x-ratelimit-reset": "1379737500"}, "url": "https://api.github.com/gists", "status_code": 201}, "recorded_at": "2013-09-21T03:57:52"}], "recorded_with": "betamax"}
1+
{"recorded_with": "betamax/0.8.0", "http_interactions": [{"response": {"body": {"string": "{\"url\":\"https://api.github.com/gists/9395aa23e0eabbb5a7e58a0166763579\",\"forks_url\":\"https://api.github.com/gists/9395aa23e0eabbb5a7e58a0166763579/forks\",\"commits_url\":\"https://api.github.com/gists/9395aa23e0eabbb5a7e58a0166763579/commits\",\"id\":\"9395aa23e0eabbb5a7e58a0166763579\",\"git_pull_url\":\"https://gist.github.com/9395aa23e0eabbb5a7e58a0166763579.git\",\"git_push_url\":\"https://gist.github.com/9395aa23e0eabbb5a7e58a0166763579.git\",\"html_url\":\"https://gist.github.com/9395aa23e0eabbb5a7e58a0166763579\",\"files\":{\"filename.py\":{\"filename\":\"filename.py\",\"type\":\"application/x-python\",\"language\":\"Python\",\"raw_url\":\"https://gist.githubusercontent.com/sigmavirus24/9395aa23e0eabbb5a7e58a0166763579/raw/dc60090e8af1ccb3fb2151390b56d02ca8c2623c/filename.py\",\"size\":8,\"truncated\":false,\"content\":\"#content\"}},\"public\":true,\"created_at\":\"2017-02-01T12:31:17Z\",\"updated_at\":\"2017-02-01T12:31:17Z\",\"description\":\"Gist Title\",\"comments\":0,\"user\":null,\"comments_url\":\"https://api.github.com/gists/9395aa23e0eabbb5a7e58a0166763579/comments\",\"owner\":{\"login\":\"sigmavirus24\",\"id\":240830,\"avatar_url\":\"https://avatars.githubusercontent.com/u/240830?v=3\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/sigmavirus24\",\"html_url\":\"https://github.com/sigmavirus24\",\"followers_url\":\"https://api.github.com/users/sigmavirus24/followers\",\"following_url\":\"https://api.github.com/users/sigmavirus24/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/sigmavirus24/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/sigmavirus24/subscriptions\",\"organizations_url\":\"https://api.github.com/users/sigmavirus24/orgs\",\"repos_url\":\"https://api.github.com/users/sigmavirus24/repos\",\"events_url\":\"https://api.github.com/users/sigmavirus24/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/sigmavirus24/received_events\",\"type\":\"User\",\"site_admin\":false},\"forks\":[],\"history\":[{\"user\":{\"login\":\"sigmavirus24\",\"id\":240830,\"avatar_url\":\"https://avatars.githubusercontent.com/u/240830?v=3\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/sigmavirus24\",\"html_url\":\"https://github.com/sigmavirus24\",\"followers_url\":\"https://api.github.com/users/sigmavirus24/followers\",\"following_url\":\"https://api.github.com/users/sigmavirus24/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/sigmavirus24/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/sigmavirus24/subscriptions\",\"organizations_url\":\"https://api.github.com/users/sigmavirus24/orgs\",\"repos_url\":\"https://api.github.com/users/sigmavirus24/repos\",\"events_url\":\"https://api.github.com/users/sigmavirus24/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/sigmavirus24/received_events\",\"type\":\"User\",\"site_admin\":false},\"version\":\"ac179de139603097d96e0a3fab20a67e7181eec1\",\"committed_at\":\"2017-02-01T12:31:17Z\",\"change_status\":{\"total\":1,\"additions\":1,\"deletions\":0},\"url\":\"https://api.github.com/gists/9395aa23e0eabbb5a7e58a0166763579/ac179de139603097d96e0a3fab20a67e7181eec1\"}],\"truncated\":false}", "encoding": "utf-8"}, "url": "https://api.github.com/gists", "status": {"code": 201, "message": "Created"}, "headers": {"Content-Type": "application/json; charset=utf-8", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", "X-RateLimit-Reset": "1485953436", "Access-Control-Expose-Headers": "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval", "Server": "GitHub.com", "Location": "https://api.github.com/gists/9395aa23e0eabbb5a7e58a0166763579", "Content-Length": "3184", "ETag": "\"8fb72f95b0ea3d24f02f024a7a5f4f65\"", "X-GitHub-Media-Type": "github.v3; param=full; format=json", "Cache-Control": "private, max-age=60, s-maxage=60", "Access-Control-Allow-Origin": "*", "X-GitHub-Request-Id": "8CA3:2C93:5BBB3AB:747BAA9:5891D515", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user", "Status": "201 Created", "X-Frame-Options": "deny", "Content-Security-Policy": "default-src 'none'", "X-RateLimit-Remaining": "4992", "X-Content-Type-Options": "nosniff", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Accepted-OAuth-Scopes": "", "X-Served-By": "d256f86292c6dde5d09d15d926ec67a3", "X-XSS-Protection": "1; mode=block", "Date": "Wed, 01 Feb 2017 12:31:17 GMT", "X-RateLimit-Limit": "5000"}}, "recorded_at": "2017-02-01T12:31:17", "request": {"method": "POST", "uri": "https://api.github.com/gists", "body": {"string": "{\"files\": {\"filename.py\": {\"content\": \"#content\"}}, \"public\": true, \"description\": \"Gist Title\"}", "encoding": "utf-8"}, "headers": {"Accept-Encoding": "gzip, deflate", "Content-Type": "application/json", "Accept-Charset": "utf-8", "Connection": "keep-alive", "Accept": "application/vnd.github.v3.full+json", "Content-Length": "96", "Authorization": "token <AUTH_TOKEN>", "User-Agent": "github3.py/1.0.0a4"}}}]}

0 commit comments

Comments
 (0)
0