Project

Profile

Help

Issue #5445

closed

"KeyError: 'relative_path'" in SingleArtifactContentSerializer

Added by daviddavis about 5 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
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.

[0] https://github.com/pulp/pulpcore/commit/342f4539c09a7accda7d2ffaaea7666b1dac0463#diff-550358b6baa6118249bdbcfa195fe88dR49


Related issues

Related to Pulp - Task #5428: Rename the fields "_relative_path" and "_artifact" on the SingleArtifactContentSerializer to "relative_path" and "artifact" respectivelyCLOSED - CURRENTRELEASEmdellweg

Actions

Also available in: Atom PDF