From 178d96783ac9fd0519a5baa672585b60e10c2f2a Mon Sep 17 00:00:00 2001 From: Dennis Kliban Date: Thu, 28 Mar 2019 07:39:41 -0400 Subject: [PATCH] Problem: publication's distributions are full URLs Solution: use DetailRelatedField instead of HyperlinkedRelatedField The serializer was using the wrong type of field for serializing the Publication's distrubtions field. fixes: #4590 https://pulp.plan.io/issues/4590 --- pulpcore/app/serializers/publication.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pulpcore/app/serializers/publication.py b/pulpcore/app/serializers/publication.py index 6bf677c778b..c6088eedf0c 100644 --- a/pulpcore/app/serializers/publication.py +++ b/pulpcore/app/serializers/publication.py @@ -27,12 +27,13 @@ class PublicationSerializer(ModelSerializer): help_text=_('The publisher that created this publication.'), queryset=models.Publisher.objects.all() ) - _distributions = serializers.HyperlinkedRelatedField( + _distributions = DetailRelatedField( help_text=_('This publication is currently being served as' 'defined by these distributions.'), many=True, read_only=True, view_name='distributions-detail', + queryset=models.BaseDistribution.objects.all() ) repository_version = NestedRelatedField( view_name='versions-detail',