Skip to content

Commit ce13cbe

Browse files
authored
Merge pull request #1044 from pulp/patchback/backports/3.22/5c3aeaebb04cc708102c91266d660d26b4b78c6c/pr-1043
[PR #1043/5c3aeaeb backport][3.22] Fix edge-case in migration 17
2 parents 7a972d3 + de925bf commit ce13cbe

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGES/1042.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed edge-case migration error in 0017_pythonpackagecontent_size.

pulp_python/app/migrations/0017_pythonpackagecontent_size.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def add_size_to_current_models(apps, schema_editor):
1414
artifact = content_artifact.artifact
1515
else:
1616
artifact = RemoteArtifact.objects.filter(content_artifact=content_artifact).first()
17-
python_package.size = artifact.size or 0
17+
python_package.size = artifact and artifact.size or 0
1818
package_bulk.append(python_package)
1919
if len(package_bulk) == 100000:
2020
with transaction.atomic():

0 commit comments

Comments
 (0)