TypeError when opening RetrieveModelVersion in a web browser for a ModelVersion that you do not have access to
Sentry Issue: ARKINDEX-BACKEND-1MB
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
(4 additional frame(s) were not displayed)
...
File "rest_framework/renderers.py", line 724, in render
context = self.get_context(data, accepted_media_type, renderer_context)
File "rest_framework/renderers.py", line 656, in get_context
raw_data_put_form = self.get_raw_data_form(data, view, 'PUT', request)
File "rest_framework/renderers.py", line 552, in get_raw_data_form
serializer = view.get_serializer(instance=instance)
File "rest_framework/generics.py", line 109, in get_serializer
kwargs.setdefault('context', self.get_serializer_context())
File "arkindex/training/api.py", line 132, in get_serializer_context
This is similar to #1458 (closed), except it happens with self.access_level
and not self.model_version
: the access_level
is set to None
when the user does not have access to the model.