Skip to content

Commit f77ae4f

Browse files
authored
Merge pull request sigmavirus24#691 from beccasjames/patch-1
Add "assignees" option to create_issue
2 parents 6a0470c + b77f661 commit f77ae4f

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

github3/github.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,12 @@ def create_gist(self, description, files, public=True):
253253

254254
@requires_auth
255255
def create_issue(self, owner, repository, title, body=None, assignee=None,
256-
milestone=None, labels=[]):
256+
milestone=None, labels=[], assignees=None):
257257
"""Create an issue on the project 'repository' owned by 'owner'
258258
with title 'title'.
259259
260-
``body``, ``assignee``, ``milestone``, ``labels`` are all optional.
260+
``body``, ``assignee``, ``assignees``, ``milestone``, ``labels``
261+
are all optional.
261262
262263
.. warning::
263264
@@ -274,6 +275,8 @@ def create_issue(self, owner, repository, title, body=None, assignee=None,
274275
formatted
275276
:param str assignee: (optional), Login of person to assign
276277
the issue to
278+
:param assignees: (optional), logins of the users to assign the
279+
issue to
277280
:param int milestone: (optional), id number of the milestone to
278281
attribute this issue to (e.g. ``m`` is a :class:`Milestone
279282
<github3.issues.Milestone>` object, ``m.number`` is what you pass
@@ -286,7 +289,8 @@ def create_issue(self, owner, repository, title, body=None, assignee=None,
286289
repo = self.repository(owner, repository)
287290

288291
if repo is not None:
289-
return repo.create_issue(title, body, assignee, milestone, labels)
292+
return repo.create_issue(title, body, assignee, milestone,
293+
labels, assignees)
290294

291295
return self._instance_or_null(Issue, None)
292296

github3/users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ class ShortUser(_User):
510510
.. versionadded:: 1.0.0
511511
"""
512512

513-
pass
513+
def _repr(self):
514+
return '<User [{s.login}]>'.format(s=self)
514515

515516

516517
class User(_User):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"http_interactions": [{"request": {"body": "", "headers": {"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": "GET", "uri": "https://api.github.com/repos/github3py/fork_this"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA+1YTY+jOBD9KxHSnDYTE0g6CdJqdi573cuc9hIZMGA1YGSbRGnU/32rbBJINPlyTiu11GoR8Ht+riqXy9V5PPWi5Xr+tlkvpl5NK+ZFXibk+1YXXHlTL2vLctu/z7ku2jhsDmQ8QuxrJr2o80qR8xrgp2EAR/r5ah3Ml29Tj+6opnLbyhJGFVo3KiIkmOXSfpgloiL2kYSbNxambBmGgU/jbLNeLtPNPEjSMN0swnn2I/3TEHwLf34L/oY/nrJa80TUambnRzZ4ny3pis0D6gewyCxMNn7sp3S1WGyCdBWvwllT56DzqGGLgr17swPgfBG04aNpSauYVGRsh0JX5cXCB5lnIzNRlmIP+Ivht6cAj/Qw9Jl55nXuQgGwjghdMHAULOMTjcOVflKOgXSwMKXBpEiiwPWSpc9J6kEgCIPssyOSNcKwtbFKJG80B48/yTmGApWQOa35B3WgAijuERT1pAgDASjbQdg+ibWYjjSS72hyQHNIljC+A+u68F2AgU4fGswD/4ws431OPTOhhi8ZLRWbwhZ+KKjPskXKTn6DGX5OjCG4FvIw0WKimdITTC4QhRORgRT8cZrw5qYzTMNWOpsVWe5Y+SrcEKGv3tnBmQOxHYH//W5IYIvSWEgKK3cmPSPpyPgnBoVmtHLmNmAgKYRwt5wBAwlXqmUPxeZ1LxgORY7BX7dVbLPTIyF/ndaiQSNViuc1Y84WOxF0Jv+jB2JJ66RwpzziO2KfjFdp7iwRsSirFLEzBxxbxBB0RBXUHg96+4oqZET8GaFk2UsSEX8i1PIFvxp5SHCig1NJg4ud9R3xpOstWNI6b2nuzngiAO/imZnTj7sVxPU9MTAAHZRUWvK4fS1RDRyo0J7AsH/dTThQDISmGrhdDNxY9KgsMMuuKn7vZL7O1sPPQvpFSozDS1r8fb+AuC0T8R0Z8qlN1j2zqzX7bH3UR7qBHwPqNc0WT7o/GqoLzEAwTUMlcxXbw0kXU8U+Z7NZVzBqitaKyRd2pUUDDZVJAeWZq77uiIdKpKLalMEZykuhLC4FTZ230YkAyKzLXDVa9DiOGrg5Ogsz4DFbxUuoDUXtniMHhjFvLTTPePJI9X99G52RdD8UrxM2pWU5haiESymHOIWCFj0GRR9zt4pFg3y4p5u4lwzq8XRLNdTSgT8Pvvub7/PlLz+IFn4Uhv/CmLZJz8aEOCZ4+xWE0WIdLX0c07SquEMD2acPDXiCa/vvbq9DyY2XYeBVqhhAfw2QyD6edRJ6SFKCjy+C8LG5dpep/zYM5BWiYg0cu15UQ7iBXP4Bz/MAOiF7qqFwg/MpEW0N1vXRdfaQPo4uqNraqPciLVu8D8GbYUeNXu75Oz8OsleRgbbiUoq+KWJliIbVPfNx+qW9CCkjZPQdejeDVvMxZRltS721BSOERUWVhv4MOJnJCvTihRm7NTStsFtjlWMADM8l9GfwPVz5aqb32A0a9I6vy19dn6+uz/jK/dX1udkHNN2r/1nX5/M/7sZ/KCMWAAA=", "encoding": "utf-8"}, "headers": {"status": "200 OK", "x-ratelimit-remaining": "4960", "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", "transfer-encoding": "chunked", "x-github-request-id": "4B79B1ED:56EA:21381E:52463041", "content-encoding": "gzip", "vary": "Accept, Authorization, Cookie, Accept-Encoding", "x-accepted-oauth-scopes": "repo, public_repo, repo:status, repo:deployment, delete_repo, site_admin", "server": "GitHub.com", "cache-control": "private, max-age=60, s-maxage=60", "last-modified": "Thu, 26 Sep 2013 23:48:50 GMT", "x-ratelimit-limit": "5000", "etag": "\"37c4fa0402ebadb9717bc8cf09b9c8e9\"", "access-control-allow-credentials": "true", "date": "Sat, 28 Sep 2013 01:26:25 GMT", "x-oauth-scopes": "user, repo, gist", "content-type": "application/json; charset=utf-8", "access-control-allow-origin": "*", "x-ratelimit-reset": "1380334381"}, "url": "https://api.github.com/repos/github3py/fork_this", "status_code": 200}, "recorded_at": "2013-09-28T01:25:38"}, {"request": {"body": "{\"body\": \"Let's see how well this works with Betamax\", \"labels\": [], \"title\": \"Test issue creation\"}", "headers": {"Content-Length": "100", "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/repos/github3py/fork_this/issues"}, "response": {"body": {"string": "{\"url\":\"https://api.github.com/repos/github3py/fork_this/issues/6\",\"labels_url\":\"https://api.github.com/repos/github3py/fork_this/issues/6/labels{/name}\",\"comments_url\":\"https://api.github.com/repos/github3py/fork_this/issues/6/comments\",\"events_url\":\"https://api.github.com/repos/github3py/fork_this/issues/6/events\",\"html_url\":\"https://github.com/github3py/fork_this/issues/6\",\"id\":20203750,\"number\":6,\"title\":\"Test issue creation\",\"user\":{\"login\":\"sigmavirus24\",\"id\":240830,\"avatar_url\":\"https://1.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\"},\"labels\":[],\"state\":\"open\",\"assignee\":null,\"milestone\":null,\"comments\":0,\"created_at\":\"2013-09-28T01:26:25Z\",\"updated_at\":\"2013-09-28T01:26:25Z\",\"closed_at\":null,\"body_html\":\"<p>Let's see how well this works with Betamax</p>\",\"body_text\":\"Let's see how well this works with Betamax\",\"body\":\"Let's see how well this works with Betamax\",\"closed_by\":null}", "encoding": "utf-8"}, "headers": {"status": "201 Created", "x-accepted-oauth-scopes": "repo, public_repo", "x-ratelimit-remaining": "4959", "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": "4B79B1ED:56EA:213843:52463041", "cache-control": "private, max-age=60, s-maxage=60", "vary": "Accept, Authorization, Cookie", "content-length": "1814", "server": "GitHub.com", "x-ratelimit-limit": "5000", "location": "https://api.github.com/repos/github3py/fork_this/issues/6", "access-control-allow-credentials": "true", "date": "Sat, 28 Sep 2013 01:26:25 GMT", "x-oauth-scopes": "user, repo, gist", "content-type": "application/json; charset=utf-8", "access-control-allow-origin": "*", "etag": "\"440eb0743eab60ef2137e6fb35569fe7\"", "x-ratelimit-reset": "1380334381"}, "url": "https://api.github.com/repos/github3py/fork_this/issues", "status_code": 201}, "recorded_at": "2013-09-28T01:25:38"}], "recorded_with": "betamax"}
1+
{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": "github3.py/1.0.0a4", "Accept-Encoding": "gzip, deflate", "Accept": "application/vnd.github.drax-preview+json", "Connection": "keep-alive", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "token <AUTH_TOKEN>"}, "method": "GET", "uri": "https://api.github.com/repos/github3py/fork_this"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA+1Yy3LrNgz9lYy2dUI7r5topnPbL+jmrrrx0BJtsZFElaTscTT59x6QlCV5aseht9l4ZArnCAQBEECXyDxJn14Wz68vj7Ok5pVI0mSt9NvSFtIks2TdluUyrG+kLdrVQ7NnYwm1q4VO0i4p1UbWgB/EACf6xY+X+8XT8yzhW265Xra6hFRhbWNSxvyimd95WGuEzlRtRW3vMlWxlgX4z+3vjyDc6MBCzAkWjtgaGYg8GmyGjRUqbFUeaeBfO/mx5FqVpdoBf6zw2U/ANAFGxnPPst7EUADWMWULAYthGx+0eWnsF9VxkA4bM3YpcyIxOAMt8q+pFEBQiE77o2NaNMqxtSuTadlYqeovqjaBgkrpDa/lO4+gApSclZT6ohIOAqjYwuO+iPWYjjVabnm2J3NokQm5hXVj+I7AoLP7hgLyr5FlyObSiiXPK4q2NS+N+JglTgcLYbcwQ3hd5OeTSM7F4Sjx0T9vnG2kVXp/Y9WNFcbeUODDMW/UGnrQn8MHz8ahYxqia/JVYvnE8CfhjoiO703sozkI2zH8hgDJELV8pTTHzqNJJyQdG/8lP7GCV9HcDgySQql4yzkwSKQxrbjIXU+fguMwrI+Huq1WPmFdEgWnaT0aOnJj5KYWItpiB4KO9bl0pXmdFfGUPb5j/smdKt9Eq0hYUKxKtYrmwPXFHEHHTMH9jWGX12hFjISfEGqxvkpFwh8Irb7iXJ16RHCgw0VlccTR+vV41gULlrzetHwTz3ggwOnSNbrh758WFadjYmAAHRVKWq7a6xLVwEEa+vsc8RtvwoFiIHQFwvma48ymR0WG23ZVyc8u69NsAT5x6SspyQ+Paen/5zXFeTUJ37Ehn/pkHZhjrRmyda/fmD9U3tFH3+NZ91vDbUEZCJ9puBaxygY461Ycdc7d3V1XCO7q2EroK6LSo0HDdVagYovVr+vxqEQqbl1lvCb1clTKpeJ5tC0PBCDzRxaro0ePz7lBVxetmAOP2SpZojZUdXyOHBjGvLWyci2zSxqC02E0Iel+GllnYsbLcgavtDKT8FMUtHRiKPpEvFU8Guqjh/adQCngstFW1sLjO+bbtlw0pdpflVFGFBSYWqBhyJfcoti/ny/ub+evt4unX/P79HGePjz8DZm2yScyP24htnj+NZ+nEJu/kkzTmmJEcyTyg0SQHoPv4gk9//913ENPQA08QMYUA+iPAZL6x8kYIkCyEk54FCWXfWt7fDedh0G9QlWiQV2QpDXigZqydzzfT+74TLU1rDufJTtuUWziTh2W+rqgJyi4WfpITVKrW+rhsNJo9Y/IrBmvDZlhJLiTb3ICpJrl0J35Jit8fIHkKbVWYRTj9Q95DFOV0EGqRtRBoV7rVwSJzERtDrv2/VcKxpF4kkKw37Hbfi7WvC3t0pfK8LeKG4upEbxH6Aq7pukBzZBCV+v3T57Vb4mSjn9Gs4vwVbul+bfl8BGXyXsx/8YtQWkqE6ZvtKB7ZIoZzx2+51jDiO97jtWPKM9P/L7nWNMpKyqgyRAMUX75HKsWdkfj5yFVjTuSsPrw8R/ymWqauRYAAA==", "string": ""}, "headers": {"Date": "Tue, 19 Dec 2017 20:21:14 GMT", "Content-Type": "application/json; charset=utf-8", "Transfer-Encoding": "chunked", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", "X-RateLimit-Remaining": "4992", "X-RateLimit-Reset": "1513715907", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", "ETag": "W/\"c5bbc08fdf5bc5d5a1860a3da503c9f8\"", "Last-Modified": "Sat, 16 Dec 2017 00:02:09 GMT", "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "github.v3; param=drax-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval", "Access-Control-Allow-Origin": "*", "Content-Security-Policy": "default-src 'none'", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "deny", "X-XSS-Protection": "1; mode=block", "X-Runtime-rack": "0.062139", "Content-Encoding": "gzip", "X-GitHub-Request-Id": "E6F8:5EA5:7D7B53:AD3298:5A3974B9"}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/repos/github3py/fork_this"}, "recorded_at": "2017-12-19T20:21:15"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"title\": \"Test issue creation\", \"body\": \"Let's see how well this works with Betamax\", \"labels\": []}"}, "headers": {"User-Agent": "github3.py/1.0.0a4", "Accept-Encoding": "gzip, deflate", "Accept": "application/vnd.github.v3.full+json", "Connection": "keep-alive", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "token <AUTH_TOKEN>", "Content-Length": "100"}, "method": "POST", "uri": "https://api.github.com/repos/github3py/fork_this/issues"}, "response": {"body": {"encoding": "utf-8", "string": "{\"url\":\"https://api.github.com/repos/github3py/fork_this/issues/14\",\"repository_url\":\"https://api.github.com/repos/github3py/fork_this\",\"labels_url\":\"https://api.github.com/repos/github3py/fork_this/issues/14/labels{/name}\",\"comments_url\":\"https://api.github.com/repos/github3py/fork_this/issues/14/comments\",\"events_url\":\"https://api.github.com/repos/github3py/fork_this/issues/14/events\",\"html_url\":\"https://github.com/github3py/fork_this/issues/14\",\"id\":283357407,\"number\":14,\"title\":\"Test issue creation\",\"user\":{\"login\":\"omgjlk\",\"id\":523287,\"avatar_url\":\"https://avatars2.githubusercontent.com/u/523287?v=4\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/omgjlk\",\"html_url\":\"https://github.com/omgjlk\",\"followers_url\":\"https://api.github.com/users/omgjlk/followers\",\"following_url\":\"https://api.github.com/users/omgjlk/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/omgjlk/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/omgjlk/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/omgjlk/subscriptions\",\"organizations_url\":\"https://api.github.com/users/omgjlk/orgs\",\"repos_url\":\"https://api.github.com/users/omgjlk/repos\",\"events_url\":\"https://api.github.com/users/omgjlk/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/omgjlk/received_events\",\"type\":\"User\",\"site_admin\":false},\"labels\":[],\"state\":\"open\",\"locked\":false,\"assignee\":null,\"assignees\":[],\"milestone\":null,\"comments\":0,\"created_at\":\"2017-12-19T20:21:15Z\",\"updated_at\":\"2017-12-19T20:21:15Z\",\"closed_at\":null,\"author_association\":\"OWNER\",\"body_html\":\"<p>Let's see how well this works with Betamax</p>\",\"body_text\":\"Let's see how well this works with Betamax\",\"body\":\"Let's see how well this works with Betamax\",\"closed_by\":null}"}, "headers": {"Date": "Tue, 19 Dec 2017 20:21:15 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "1775", "Server": "GitHub.com", "Status": "201 Created", "X-RateLimit-Limit": "5000", "X-RateLimit-Remaining": "4991", "X-RateLimit-Reset": "1513715907", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", "ETag": "\"c8220593ab9842b65a4e97be35846fd8\"", "X-OAuth-Scopes": "admin:org, delete_repo, repo", "X-Accepted-OAuth-Scopes": "", "Location": "https://api.github.com/repos/github3py/fork_this/issues/14", "X-GitHub-Media-Type": "github.v3; param=full; format=json", "Access-Control-Expose-Headers": "ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval", "Access-Control-Allow-Origin": "*", "Content-Security-Policy": "default-src 'none'", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "deny", "X-XSS-Protection": "1; mode=block", "X-Runtime-rack": "0.235708", "X-GitHub-Request-Id": "E6F8:5EA5:7D7BEF:AD3307:5A3974BA"}, "status": {"code": 201, "message": "Created"}, "url": "https://api.github.com/repos/github3py/fork_this/issues"}, "recorded_at": "2017-12-19T20:21:16"}], "recorded_with": "betamax/0.8.0"}

0 commit comments

Comments
 (0)