Skip to content

Commit 5c3aeae

Browse files
authored
Merge pull request #1043 from gerrod3/mig-17-fix
Fix edge-case in migration 17
2 parents 9f92b28 + bff04d9 commit 5c3aeae

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)