Project

Profile

Help

Issue #2977

closed

Attributes on KeyValueRelatedFields are not used by DRF

Added by bizhang over 6 years ago. Updated over 4 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:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix
Sprint:
Sprint 24
Quarter:

Description

Attributes on NotesKeyValueRelatedField[0] does not get picked up by DRF. This is evidenced by the help_text not showing up, and by DRF returning "This field is required." even when required is set to False.

If required is set to False on initialization of Notes field in the RepositorySeralizer[1]

notes = NotesKeyValueRelatedField(required=False)

DRF then picks up this field.

[0] https://github.com/pulp/pulp/blob/3.0-dev/platform/pulpcore/app/serializers/generic.py#L16
[1] https://github.com/pulp/pulp/blob/3.0-dev/platform/pulpcore/app/serializers/repository.py#L40


Related issues

Related to Pulp - Issue #2947: Notes field on the Repository model should default to {}CLOSED - WONTFIXdaviddavisActions

Also available in: Atom PDF