Actions
Issue #5445
closed"KeyError: 'relative_path'" in SingleArtifactContentSerializer
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
Description
We're seeing this issue in pulp_ansible:
Traceback (most recent call last):
File "/home/travis/build/pulp/pulp_ansible/pulp_ansible/tests/unit/test_serializers.py", line 41, in test_duplicate_data
serializer = RoleSerializer(data=self.data, context={"view": view})
File "/home/travis/build/pulp/pulpcore/pulpcore/app/serializers/content.py", line 49, in __init__
self.fields["relative_path"].write_only = False
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rest_framework/utils/serializer_helpers.py", line 148, in __getitem__
return self.fields[key]
KeyError: 'relative_path'
The problem here[0] is that the Role model in pulp_ansible has a relative_path but it's not on the serializer.
Related issues
Actions
Ensure that relative_path is defined on the serializer
fixes #5445 https://pulp.plan.io/issues/5445