From e0b5820bc25ea0ab35186f664d578bbe667cf52b Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 24 Jan 2024 16:32:42 -0500 Subject: [PATCH] membershipworks: Don't try to set generated fields in `from_api_dict` --- membershipworks/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index 2eb0d64..d34cbfb 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -29,7 +29,12 @@ class BaseModel(models.Model): def _remap_headers(cls, data): for field in cls._meta.get_fields(): # TODO: more robust filtering of fields that don't have a column - if field.auto_created or field.many_to_many or not field.concrete: + if ( + field.auto_created + or field.many_to_many + or not field.concrete + or field.generated + ): continue field_name, api_name = field.get_attname_column()