Skip to content

Commit

Permalink
Remove broken retrieve for advisories
Browse files Browse the repository at this point in the history
fixes #3195

(cherry picked from commit 0ba8011)
  • Loading branch information
mdellweg authored and patchback[bot] committed Jul 20, 2023
1 parent 0ba09d3 commit 6468fbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES/3195.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove the non functional ``retrieve`` logic from advisories upload, fixing a bug that appeared
with pulpcore >= 3.29.
12 changes: 3 additions & 9 deletions pulp_rpm/app/serializers/advisory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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 + (
Expand Down

0 comments on commit 6468fbf

Please sign in to comment.