From 6468fbf0478007d24084e68a208ab8d045a4a96d Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Thu, 13 Jul 2023 14:48:15 +0200 Subject: [PATCH] Remove broken retrieve for advisories fixes #3195 (cherry picked from commit 0ba80116d593b3cd15252593fe9681af71bff93a) --- CHANGES/3195.bugfix | 2 ++ pulp_rpm/app/serializers/advisory.py | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) create mode 100644 CHANGES/3195.bugfix diff --git a/CHANGES/3195.bugfix b/CHANGES/3195.bugfix new file mode 100644 index 000000000..7709acf87 --- /dev/null +++ b/CHANGES/3195.bugfix @@ -0,0 +1,2 @@ +Remove the non functional ``retrieve`` logic from advisories upload, fixing a bug that appeared +with pulpcore >= 3.29. diff --git a/pulp_rpm/app/serializers/advisory.py b/pulp_rpm/app/serializers/advisory.py index bc6147f4e..ffffa90b9 100644 --- a/pulp_rpm/app/serializers/advisory.py +++ b/pulp_rpm/app/serializers/advisory.py @@ -10,7 +10,6 @@ ModelSerializer, NoArtifactContentUploadSerializer, ) -from pulpcore.plugin.util import get_domain_pk from pulp_rpm.app.advisory import hash_update_record from pulp_rpm.app.fields import ( @@ -232,15 +231,10 @@ def validate(self, data): validated_data = super().validate(update_record_data) return validated_data - # pulpcore 3.22 feature - # TODO upload has to be able to "find" a unique advisory, and id is Not It? - # when uploading content second time I don't get error but already existing content def retrieve(self, validated_data): - content = UpdateRecord.objects.filter( - id=validated_data["id"], - pulp_domain=get_domain_pk(), - ) - return content.first() + # This feature cannot be implemented until we can reliably calculate the digest of the + # advisory before saving anything to the database. By current standards, we can't. + return None class Meta: fields = NoArtifactContentUploadSerializer.Meta.fields + (