Skip to content

Don't expect commit_id for PullReview #944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/github3/pulls.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,12 @@ class PullReview(models.GitHubCore):

The SHA of the commit that the review was left on.

.. note::

It is possible for the attribute to be set to ``None``, if the
review references a commit that is no longer available in the pull
request branch, such as after a force push.

.. attribute:: html_url

.. versionadded:: 1.0.0
Expand Down Expand Up @@ -958,7 +964,9 @@ def _update_attributes(self, review):
self.body = review["body"]
self.body_html = review["body_html"]
self.body_text = review["body_text"]
self.commit_id = review["commit_id"]
# NOTE(pabelanger): In some cases, commit_id could be missing on a
# PullReview.
self.commit_id = review.get("commit_id", None)
self.html_url = review["html_url"]
self.user = users.ShortUser(review["user"], self)
self.state = review["state"]
Expand Down