csv_import: use flag default value (#37900)
Attribute instance can be unpickled and miss attributes added after the creation of the pickle.
This commit is contained in:
parent
f713d64735
commit
84b8f31ae1
|
@ -165,7 +165,7 @@ class CsvHeader(object):
|
|||
flags = []
|
||||
for attribute in attr.fields(self.__class__):
|
||||
if attribute.metadata.get('flag'):
|
||||
if getattr(self, attribute.name):
|
||||
if getattr(self, attribute.name, attribute.default):
|
||||
flags.append(attribute.name)
|
||||
else:
|
||||
flags.append('no-' + attribute.name.replace('_', '-'))
|
||||
|
|
Loading…
Reference in New Issue