File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -926,6 +926,12 @@ class PullReview(models.GitHubCore):
926
926
927
927
The SHA of the commit that the review was left on.
928
928
929
+ .. note::
930
+
931
+ It is possible for the attribute to be set to ``None``, if the
932
+ review references a commit that is no longer available in the pull
933
+ request branch, such as after a force push.
934
+
929
935
.. attribute:: html_url
930
936
931
937
.. versionadded:: 1.0.0
@@ -958,7 +964,9 @@ def _update_attributes(self, review):
958
964
self .body = review ["body" ]
959
965
self .body_html = review ["body_html" ]
960
966
self .body_text = review ["body_text" ]
961
- self .commit_id = review ["commit_id" ]
967
+ # NOTE(pabelanger): In some cases, commit_id could be missing on a
968
+ # PullReview.
969
+ self .commit_id = review .get ("commit_id" , None )
962
970
self .html_url = review ["html_url" ]
963
971
self .user = users .ShortUser (review ["user" ], self )
964
972
self .state = review ["state" ]
You can’t perform that action at this time.
0 commit comments