8000 Fix-up a few bugs in our code · pythonthings/github3.py@dc337de · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit dc337de

Browse files
committed
Fix-up a few bugs in our code
While re-recording cassettes I discovered a couple tiny bugs
1 parent cf5c0d7 commit dc337de

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

github3/pulls.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,15 +428,26 @@ def reviews(self, number=-1, etag=None):
428428
headers=headers)
429429

430430
@requires_auth
431-
def update(self, title=None, body=None, state=None):
431+
def update(self, title=None, body=None, state=None, base=None,
432+
maintainer_can_modify=None):
432433
"""Update this pull request.
433434
434435
:param str title: (optional), title of the pull
435436
:param str body: (optional), body of the pull request
436437
:param str state: (optional), ('open', 'closed')
438+
:param str base: (optional), Name of the branch on the current
439+
repository that the changes should be pulled into.
440+
:param bool maintainer_can_modify: (optional), Indicates whether
441+
a maintainer is allowed to modify the pull request or not.
437442
:returns: bool
438443
"""
439-
data = {'title': title, 'body': body, 'state': state}
444+
data = {
445+
'title': title,
446+
'body': body,
447+
'state': state,
448+
'base': base,
449+
'maintainer_can_modify': maintainer_can_modify,
450+
}
440451
json = None
441452
self._remove_none(data)
442453

@@ -553,7 +564,7 @@ def reply(self, body):
553564
"""
554565
url = self._build_url('comments', base_url=self.pull_request_url)
555566
index = self._api.rfind('/') + 1
556-
in_reply_to = self._api[index:]
567+
in_reply_to = int(self._api[index:])
557568
json = self._json(self._post(url, data={
558569
'body': body, 'in_reply_to': in_reply_to
559570
}), 201)

github3/repos/status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ def _update_attributes(self, combined_status):
7676
statuses = self._get_attribute(combined_status, 'statuses', [])
7777
self.statuses = [Status(s) for s in statuses]
7878

79-
from . import Repository
79+
from . import repo
8080
#: Repository the combined status belongs too.
8181
self.repository = self._class_attribute(
82-
combined_status, 'repository', Repository, self
82+
combined_status, 'repository', repo.ShortRepository, self
8383
)
8484

8585
#: commit URL

0 commit comments

Comments
 (0)
0