Fix import PayPal capitalization bug

This commit is contained in:
Tanner Collin 2020-02-06 09:52:10 +00:00
parent c865480c8b
commit 202dc1f999

View File

@ -118,7 +118,11 @@ for o in old:
new = {}
for f in TRANSACTION_FIELDS:
new[f] = o.__dict__.get(f, None).replace('Paypal', 'PayPal')
tmp = o.__dict__.get(f, None)
if isinstance(tmp, str):
new[f] = tmp.replace('Paypal', 'PayPal')
else:
new[f] = tmp
models.Transaction.objects.create(**new)
print('Imported transaction #{} - {} {}'.format(