thrimshim: Handle None values in comparing columns

pull/206/head
Mike Lang 4 years ago
parent cb75953e91
commit 6d789ad42f

@ -253,6 +253,8 @@ def update_row(ident, editor=None):
def normalize(value): def normalize(value):
if isinstance(value, list): if isinstance(value, list):
return sorted(map(normalize, value)) return sorted(map(normalize, value))
if value is None:
return None
return value.lower().strip() return value.lower().strip()
if normalize(new_row[column]) != normalize(old_row[column]): if normalize(new_row[column]) != normalize(old_row[column]):
changes += '{}: {} => {}\n'.format(column, new_row[column], old_row[column]) changes += '{}: {} => {}\n'.format(column, new_row[column], old_row[column])

Loading…
Cancel
Save