ValidationError when sending a non-UUID or an UUID of a WorkerVersion that does not exist in ListTranscriptionEntities
Sentry Issue: ARKINDEX-BACKEND-1BR
ValidationError: {'worker_version': ['Invalid UUID.']}
(7 additional frame(s) were not displayed)
...
File "rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "drf_spectacular/utils.py", line 448, in wrapped_method
return method(self, request, *args, **kwargs)
File "rest_framework/generics.py", line 199, in get
return self.list(request, *args, **kwargs)
File "rest_framework/mixins.py", line 38, in list
queryset = self.filter_queryset(self.get_queryset())
File "arkindex/documents/api/entities.py", line 307, in get_queryset
I am creating this issue just to document that this bug existed—this has been found by @vrigal and will be fixed in !1835 (merged). A ValidationError
was thrown outside of a context where DRF would have caught it to cause HTTP 400, causing HTTP 500 instead. This occurs by sending ?worker_version=lol
, or anything that isn't a UUID or is an UUID of a WorkerVersion that does not exist, to ListTranscriptionEntities
.