Skip to content

Commit

Permalink
Use RelatedField for signing services
Browse files Browse the repository at this point in the history
closes #9563

The field referencing a signing service on a publication now uses
pulpcore.plugin.serializers.RelatedField, rather than:
rest_framework.serializers.HyperlinkedRelatedField

The latter was causing a full URL to be stored, which in turn causes
various usability issues and is inconsistent with everything else in
Pulp (which use pulp_href only).

Signed-off-by: Joshua Schmid <jaiks@posteo.de>
  • Loading branch information
jschmid1 committed Jan 11, 2022
1 parent 409694e commit 3e52022
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/9563.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug causing publications to reference any ``AptReleaseSigningService`` via a full URL instead of just a ``pulp_href``.
5 changes: 3 additions & 2 deletions pulp_deb/app/serializers/publication_serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from rest_framework.serializers import BooleanField, ValidationError, HyperlinkedRelatedField
from rest_framework.serializers import BooleanField, ValidationError
from pulpcore.plugin.models import Publication
from pulpcore.plugin.serializers import (
RelatedField,
DistributionSerializer,
PublicationSerializer,
DetailRelatedField,
Expand Down Expand Up @@ -34,7 +35,7 @@ class AptPublicationSerializer(PublicationSerializer):
default=False,
)
structured = BooleanField(help_text="Activate structured publishing mode.", default=False)
signing_service = HyperlinkedRelatedField(
signing_service = RelatedField(
help_text="Sign Release files with this signing key",
many=False,
queryset=AptReleaseSigningService.objects.all(),
Expand Down

0 comments on commit 3e52022

Please sign in to comment.