membershipworks: Allow missing fields in transactions json

This commit is contained in:
Adam Goldsmith 2022-03-24 19:45:13 -04:00
parent b8b6e7abf1
commit 3fcfddb221

View File

@ -311,10 +311,20 @@ class Transaction(BaseModel):
txn["_dp"] = datetime.fromtimestamp(
txn["_dp"], tz=timezone.get_current_timezone()
)
allowed_missing_fields = [
"sid",
"uid",
"eid",
"fee",
"sum",
]
for field in allowed_missing_fields:
if field not in txn:
txn[field] = None
return super().from_csv_dict(txn)
_csv_headers_override = {
"member_id": "uid",
"event_id": "eid",
"timestamp": "_dp",
"type": "Transaction Type",
"for_what": "Event/Form Name",