From 929fcd9443c13c3fd89189d7f735f54ca36b08af Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Wed, 3 May 2023 16:41:12 -0500 Subject: [PATCH] Serializer.validate must return validated data. Fixes #1441 --- CHANGES/1441.bugfix | 1 + pulp_ansible/app/galaxy/serializers.py | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 CHANGES/1441.bugfix diff --git a/CHANGES/1441.bugfix b/CHANGES/1441.bugfix new file mode 100644 index 000000000..1f09d98b4 --- /dev/null +++ b/CHANGES/1441.bugfix @@ -0,0 +1 @@ +Fix traceback when publishing a collection to the v2 API endpoint diff --git a/pulp_ansible/app/galaxy/serializers.py b/pulp_ansible/app/galaxy/serializers.py index f0b5c3720..f07413c47 100644 --- a/pulp_ansible/app/galaxy/serializers.py +++ b/pulp_ansible/app/galaxy/serializers.py @@ -191,7 +191,9 @@ class GalaxyCollectionUploadSerializer(serializers.Serializer): def validate(self, data): """Ensure duplicate artifact isn't uploaded.""" + data = super().validate(data) sha256 = data["file"].hashers["sha256"].hexdigest() artifact = Artifact.objects.filter(sha256=sha256).first() if artifact: raise serializers.ValidationError(_("Artifact already exists")) + return data