From 202dc1f99929638841557bb29fa188d8d4d21643 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 6 Feb 2020 09:52:10 +0000 Subject: [PATCH] Fix import PayPal capitalization bug --- apiserver/import_old_portal.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apiserver/import_old_portal.py b/apiserver/import_old_portal.py index 5d5bc29..9ceba65 100755 --- a/apiserver/import_old_portal.py +++ b/apiserver/import_old_portal.py @@ -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(