importers.patreon: Handle commas in large amounts.
This commit is contained in:
parent
a2120805ab
commit
4796932cb7
3 changed files with 6 additions and 7 deletions
|
@ -8,11 +8,9 @@ class IncomeImporter(_csv.CSVImporterBase):
|
||||||
NEEDED_FIELDS = frozenset([
|
NEEDED_FIELDS = frozenset([
|
||||||
'FirstName',
|
'FirstName',
|
||||||
'LastName',
|
'LastName',
|
||||||
|
'Pledge',
|
||||||
'Status',
|
'Status',
|
||||||
])
|
])
|
||||||
COPIED_FIELDS = {
|
|
||||||
'Pledge': 'amount',
|
|
||||||
}
|
|
||||||
ENTRY_SEED = {
|
ENTRY_SEED = {
|
||||||
'currency': 'USD',
|
'currency': 'USD',
|
||||||
}
|
}
|
||||||
|
@ -30,6 +28,7 @@ class IncomeImporter(_csv.CSVImporterBase):
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
return {
|
return {
|
||||||
|
'amount': row['Pledge'].replace(',', ''),
|
||||||
'payee': '{0[FirstName]} {0[LastName]}'.format(row),
|
'payee': '{0[FirstName]} {0[LastName]}'.format(row),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
FirstName,LastName,Email,Pledge,Lifetime,Status,Twitter,Street,City,State,Zip,Country,Start,MaxAmount,Complete
|
FirstName,LastName,Email,Pledge,Lifetime,Status,Twitter,Street,City,State,Zip,Country,Start,MaxAmount,Complete
|
||||||
100 + Reward,Description You donate a lot of money!,,,,,,,,,,,,,
|
100 + Reward,Description You donate a lot of money!,,,,,,,,,,,,,
|
||||||
Alex,Jones,alex@example.org,150,300,Processed,,,,,,,2017-08-11 11:28:06.166065,200,0
|
Alex,Jones,alex@example.org,"1,500.00","3,000.00",Processed,,,,,,,2017-08-11 11:28:06.166065,"2,000.00",0
|
||||||
5 + Reward,Description You’re nice!,,,,,,,,,,,,,
|
5 + Reward,Description You’re nice!,,,,,,,,,,,,,
|
||||||
Brett,Smith,brett@example.org,10,30,Declined,Brett20XX,,,,,,2017-08-10 13:24:15.955782,10,0
|
Brett,Smith,brett@example.org,10.00,30.00,Declined,Brett20XX,,,,,,2017-08-10 13:24:15.955782,10.00,0
|
||||||
Dakota,Doe,ddoe@example.org,12,48,Processed,,,,,,,2017-08-10 12:58:31.919341,12,0
|
Dakota,Doe,ddoe@example.org,12.00,48.00,Processed,,,,,,,2017-08-10 12:58:31.919341,12.00,0
|
||||||
|
|
|
|
@ -3,7 +3,7 @@
|
||||||
expect:
|
expect:
|
||||||
- payee: Alex Jones
|
- payee: Alex Jones
|
||||||
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
||||||
amount: !!python/object/apply:decimal.Decimal ["150.00"]
|
amount: !!python/object/apply:decimal.Decimal ["1500.00"]
|
||||||
currency: USD
|
currency: USD
|
||||||
- payee: Dakota Doe
|
- payee: Dakota Doe
|
||||||
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
||||||
|
|
Loading…
Reference in a new issue