Skip to content

Commit

Permalink
Fix content directory list 500 when RemoteArtifact had null size
Browse files Browse the repository at this point in the history
fixes: #5318
  • Loading branch information
gerrod3 authored and mdellweg committed May 13, 2024
1 parent 7ba0a9b commit 1161c72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/5318.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed content directory listing returning 500 in certain scenarios due to missing artifact sizes.
2 changes: 1 addition & 1 deletion pulpcore/content/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def list_directory_blocking():
)
# Find the sizes for on_demand artifacts
r_artifacts = RemoteArtifact.objects.filter(
content_artifact__in=artifacts_to_find.keys()
content_artifact__in=artifacts_to_find.keys(), size__isnull=False
).values_list("content_artifact_id", "size")
sizes.update({artifacts_to_find[ra_ca_id]: size for ra_ca_id, size in r_artifacts})

Expand Down

0 comments on commit 1161c72

Please sign in to comment.