diff --git a/CHANGES/+distribution_create.bugfix b/CHANGES/+distribution_create.bugfix new file mode 100644 index 000000000..46a2e72b7 --- /dev/null +++ b/CHANGES/+distribution_create.bugfix @@ -0,0 +1 @@ +Fixed a bug on distribution create that failed to serialize the full registry path in the task context. diff --git a/pulp_container/app/serializers.py b/pulp_container/app/serializers.py index 134670386..6ebca247b 100644 --- a/pulp_container/app/serializers.py +++ b/pulp_container/app/serializers.py @@ -228,8 +228,11 @@ def to_representation(self, value): """ Converts a base_path into a registry path. """ - request = self.context["request"] - return f"{request.get_host()}/{get_full_path(value)}" + request = self.context.get("request") + if request is not None: + return f"{request.get_host()}/{get_full_path(value)}" + else: + return get_full_path(value) class ContainerNamespaceSerializer(ModelSerializer, GetOrCreateSerializerMixin):