membershipworks: Use get_attname_column() to get correct field name/column

This commit is contained in:
Adam Goldsmith 2022-03-24 19:44:28 -04:00
parent 18a811ce44
commit b8b6e7abf1

View File

@ -22,11 +22,12 @@ class BaseModel(models.Model):
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:
continue continue
csv_header = field.column field_name, csv_header = field.get_attname_column()
if field.name in cls._csv_headers_override:
if field_name in cls._csv_headers_override:
csv_header = cls._csv_headers_override[field.name] csv_header = cls._csv_headers_override[field.name]
yield field.name, data[csv_header] yield field_name, data[csv_header]
@classmethod @classmethod
def from_csv_dict(cls, data): def from_csv_dict(cls, data):