From 3fcfddb221ffab46ac02c4e0fd099cace2418ee4 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 24 Mar 2022 19:45:13 -0400 Subject: [PATCH] membershipworks: Allow missing fields in transactions json --- membershipworks/models.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index fec3ad4..ce9b025 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -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",