Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
Closed
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
12 changes: 3 additions & 9 deletions graphs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,11 @@ def get_coverage(self):
return None, coverage_range

branch_name = self.kwargs.get("branch") or repo.branch
branch = Branch.objects.filter(
branch_qs = Branch.objects.filter(
name=branch_name, repository_id=repo.repoid
).first()

if branch is None:
log.warning(
"Branch not found", extra=dict(branch_name=branch_name, repo=repo)
)
return None, coverage_range
)
try:
commit = repo.commits.filter(commitid=branch.head).first()
commit = repo.commits.filter(commitid__in=branch_qs.values_list("head", flat=True)).first()
except ObjectDoesNotExist:
# if commit does not exist return None coverage
log.warning("Commit not found", extra=dict(commit=branch.head))
Expand Down
Loading