Skip to content

Commit

Permalink
Builds: check for nonexistent object (#8261)
Browse files Browse the repository at this point in the history
  • Loading branch information
stsewd authored Jun 15, 2021
1 parent 500a93a commit d61b921
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion readthedocs/builds/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ def send_build_status(build_pk, commit, status, link_to_build=False):
:param status: build status failed, pending, or success to be sent.
"""
# TODO: Send build status for BitBucket.
build = Build.objects.get(pk=build_pk)
build = Build.objects.filter(pk=build_pk).first()
if not build:
return

provider_name = build.project.git_provider_name

log.info('Sending build status. build=%s, project=%s', build.pk, build.project.slug)
Expand Down

0 comments on commit d61b921

Please sign in to comment.