membershipworks: Don't try to set generated fields in from_api_dict
All checks were successful
Ruff / ruff (push) Successful in 22s

This commit is contained in:
Adam Goldsmith 2024-01-24 16:32:42 -05:00
parent 5f59aac67e
commit e0b5820bc2

View File

@ -29,7 +29,12 @@ class BaseModel(models.Model):
def _remap_headers(cls, data): def _remap_headers(cls, data):
for field in cls._meta.get_fields(): for field in cls._meta.get_fields():
# TODO: more robust filtering of fields that don't have a column # 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 continue
field_name, api_name = field.get_attname_column() field_name, api_name = field.get_attname_column()