Unhandled ValidationError when sending an invalid ID to RemoveSelection
Sentry Issue: ARKINDEX-BACKEND-1KF
AttributeError: 'dict' object has no attribute 'replace'
File "django/db/models/fields/__init__.py", line 2649, in to_python
return uuid.UUID(**{input_form: value})
File "uuid.py", line 174, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
ValidationError: ["“{'id': '03dbc07d-cf05-4ff6-9170-ed8625376cb1', 'type': 'page', 'name': 'BIS_00_01140_V02_0224.jpg', 'corpus': {'id': '4612a242-48fb-4796-9619-1a88b5782fc8', 'name': 'BIS | ECRU', 'public': False}, 'thumbnail_url': None, 'zone': {'id': '03dbc07d-cf05-4ff6-9170-ed8625376cb1', 'polygon': [[0, 0], [0, 3600], [2664, 3600], [2664, 0], [0, 0]], 'image': {'id': '6b514c1a-7fca-4073-8b3b-66792a4dc541', 'path': 'bis-ecru%2FBIS_00_01140_V02%2FIMAGES%2FJPG%2FBIS_00_01140_V02_0224.jpg', 'width': 2664, 'height': 3600, 'url': 'https://europe-gamma.iiif.teklia.com/iiif/2/bis-ecru%2FBIS_00_01140_V02%2FIMAGES%2FJPG%2FBIS_00_01140_V02_0224.jpg', 's3_url': None, 'status': 'checked', 'server': {'display_name': 'https://europe-gamma.iiif.teklia.com/iiif/2', 'url': 'https://europe-gamma.iiif.teklia.com/iiif/2', 'max_width': None, 'max_height': None}}, 'url': 'https://europe-gamma.iiif.teklia.com/iiif/2/bis-ecru%2FBIS_00_01140_V02%2FIMAGES%2FJPG%2FBIS_00_01140_V02_0224.jpg/0,0,2664,3600/full/0/default.jpg'}, 'rotation_angle': 0...
(18 additional frame(s) were not displayed)
...
File "django/db/models/lookups.py", line 27, in __init__
self.rhs = self.get_prep_lookup()
File "django/db/models/lookups.py", line 341, in get_prep_lookup
return super().get_prep_lookup()
File "django/db/models/lookups.py", line 85, in get_prep_lookup
return self.lhs.output_field.get_prep_value(self.rhs)
File "django/db/models/fields/__init__.py", line 2633, in get_prep_value
return self.to_python(value)
File "django/db/models/fields/__init__.py", line 2651, in to_python
raise exceptions.ValidationError(
To reproduce:
cli.request('RemoveSelection', body={'id': 'a' * 9001})