Skip to content

Commit

Permalink
fix: Use of mixin for JobAccess
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Jan 22, 2025
1 parent eb59c43 commit 5eb04ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions viewer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))

Expand Down

0 comments on commit 5eb04ea

Please sign in to comment.