Skip to content

Commit f009c56

Browse files
Address AI feedback 2
Signed-off-by: Lukasz Gryglicki <[email protected]> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
1 parent 3d1c7cc commit f009c56

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cla-backend/cla/models/github_models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,8 +2644,10 @@ def update_pull_request(
26442644
cla.log.debug(f"{fn} - Updating PR {pull_request.number} with notification={notification}, both={both}")
26452645
try:
26462646
last_commit_sha = getattr(getattr(pull_request, "head", None), "sha", None)
2647-
# commit_obj = pull_request.base.repo.get_commit(last_commit_sha)
2648-
commit_obj = pull_request.head.repo.get_commit(last_commit_sha)
2647+
repo = getattr(getattr(pull_request, "head", None), "repo", None)
2648+
if repo is None:
2649+
repo = getattr(getattr(pull_request, "base", None), "repo", None)
2650+
commit_obj = repo.get_commit(last_commit_sha)
26492651
except (GithubException, AttributeError, TypeError) as exc:
26502652
cla.log.error(f"{fn} - PR {pull_request.number}: exception getting head.sha: {exc}")
26512653
try:

0 commit comments

Comments
 (0)