Merge pull request #2588 from SchrodingersGat/migration-fix

Prevent AttributeError from being thrown
This commit is contained in:
Oliver 2022-02-02 13:34:04 +11:00 committed by GitHub
commit a41eca1cb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ def extract_purchase_price(apps, schema_editor):
if lines.exists(): if lines.exists():
for line in lines: for line in lines:
if line.purchase_price is not None: if getattr(line, 'purchase_price', None) is not None:
# Copy pricing information across # Copy pricing information across
item.purchase_price = line.purchase_price item.purchase_price = line.purchase_price