Skip to content

Commit ff68393

Browse files
committed
Match main
1 parent da2abd5 commit ff68393

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

readthedocs/api/v2/views/model_views.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from django.db.models import Value
1313
from django.db.models import When
1414
from django.http import Http404
15-
from django.shortcuts import get_object_or_404
1615
from django.template.loader import render_to_string
1716
from django.utils import timezone
1817
from rest_framework import decorators
@@ -311,12 +310,7 @@ def concurrent(self, request, **kwargs):
311310
methods=["post"],
312311
)
313312
def healthcheck(self, request, **kwargs):
314-
# We can't use `self.get_object()` here because it uses `get_queryset()` method that it's filtered by build API key and/or user access.
315-
# Since we don't want to check for permissions here (only based on `?builder=` GET attribute) we need to query the db manually here.
316-
lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
317-
filter_kwargs = {self.lookup_field: self.kwargs[lookup_url_kwarg]}
318-
build = get_object_or_404(Build.objects.all(), **filter_kwargs)
319-
313+
build = self.get_object()
320314
builder_hostname = request.GET.get("builder")
321315
structlog.contextvars.bind_contextvars(
322316
build_id=build.pk,

0 commit comments

Comments
 (0)