KeyError when opening ApplyProcessTemplate in a web browser
Sentry Issue: ARKINDEX-BACKEND-XF
KeyError: 'process_id'
(6 additional frame(s) were not displayed)
...
File "rest_framework/renderers.py", line 554, in get_raw_data_form
serializer = view.get_serializer()
File "rest_framework/generics.py", line 109, in get_serializer
kwargs.setdefault('context', self.get_serializer_context())
File "arkindex/dataimport/api.py", line 1659, in get_serializer_context
File "rest_framework/generics.py", line 99, in get_object
self.check_object_permissions(self.request, obj)
File "arkindex/dataimport/api.py", line 1643, in check_object_permissions
- Create a template
- Get its UUID
- Open
/api/v1/process/<template id>/
in your browser - Enjoy the HTTP 500!
Maybe the object permission validation needs to be moved to a field with a custom validation on the serializer itself: this would avoid the use of request.data
, which bypasses the serializer.
Edited by Erwan Rouchet