From 58aa4e2128abf01605becc3d083f33006e1f3683 Mon Sep 17 00:00:00 2001 From: Quirin Pamp Date: Wed, 2 Sep 2026 13:49:40 +0200 Subject: [PATCH] Do not create ReleaseArchitecture for arch=all --- CHANGES/+no-arch-all-validation.removal | 2 ++ pulp_deb/app/serializers/content_serializers.py | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 CHANGES/+no-arch-all-validation.removal diff --git a/CHANGES/+no-arch-all-validation.removal b/CHANGES/+no-arch-all-validation.removal new file mode 100644 index 000000000..b0c5b9b76 --- /dev/null +++ b/CHANGES/+no-arch-all-validation.removal @@ -0,0 +1,2 @@ +Added validation that prevents users from creating ReleaseArchitecture content for the special value "Architecture: all". +If you have previously created the content unit you can keep using it. diff --git a/pulp_deb/app/serializers/content_serializers.py b/pulp_deb/app/serializers/content_serializers.py index 3a8b763fc..656d038c1 100644 --- a/pulp_deb/app/serializers/content_serializers.py +++ b/pulp_deb/app/serializers/content_serializers.py @@ -913,6 +913,16 @@ class ReleaseArchitectureSerializer(NoArtifactContentSerializer): help_text="Architecture variant name, if this architecture is a variant.", ) + def validate(self, data): + """ + Ensure we do not create a ReleaseArchitecture object for special value 'all'. + """ + data = super().validate(data) + if data.get("architecture") == "all": + message = "This field does not accept the special value 'all'!" + raise ValidationError({"architecture": _(message)}) + return data + def get_unique_together_validators(self): """ We do not want UniqueTogetherValidator since we have retrieve logic!