From 5eb04ea27b41473ba11b3e61446f475bc5810008 Mon Sep 17 00:00:00 2001 From: Alan Christie Date: Wed, 22 Jan 2025 11:38:33 +0000 Subject: [PATCH] fix: Use of mixin for JobAccess --- viewer/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/viewer/views.py b/viewer/views.py index 8ecc2eab..c186cfbf 100644 --- a/viewer/views.py +++ b/viewer/views.py @@ -2532,7 +2532,7 @@ def update(self, request, code=None): return HttpResponse(status=204) -class JobAccessView(viewsets.ReadOnlyModelViewSet): +class JobAccessView(mixins.ListModelMixin): """JobAccess (api/job_access) Django view that calls Squonk to allow a user (who is able to see a Job) @@ -2545,8 +2545,10 @@ class JobAccessView(viewsets.ReadOnlyModelViewSet): queryset = models.JobRequest.objects.filter() serializer_class = serializers.JobAccessReadSerializer - def retrieve(self, request): - """Method to handle GET request""" + def list(self, request): + """Method to handle a general GET request. All we do here is custom logic, + the user cannot use this endpoint to get anything, it simply provides + user-accesss to a Job in Squonk.""" query_params = request.query_params logger.info('+ JobAccessView/GET %s', json.dumps(query_params))