Builds: check for nonexistent object
@@ -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)
