Avoid potential bugs when generating CSV results data for download
This commit is contained in:
parent
46b49ab987
commit
f8e98a5817
|
@ -1527,7 +1527,7 @@ class MasterView(View):
|
||||||
"""
|
"""
|
||||||
csvrow = {}
|
csvrow = {}
|
||||||
for field in fields:
|
for field in fields:
|
||||||
value = getattr(obj, field)
|
value = getattr(obj, field, None)
|
||||||
csvrow[field] = '' if value is None else six.text_type(value)
|
csvrow[field] = '' if value is None else six.text_type(value)
|
||||||
return csvrow
|
return csvrow
|
||||||
|
|
||||||
|
@ -1537,7 +1537,7 @@ class MasterView(View):
|
||||||
"""
|
"""
|
||||||
csvrow = {}
|
csvrow = {}
|
||||||
for field in fields:
|
for field in fields:
|
||||||
value = getattr(row, field)
|
value = getattr(row, field, None)
|
||||||
csvrow[field] = '' if value is None else six.text_type(value)
|
csvrow[field] = '' if value is None else six.text_type(value)
|
||||||
return csvrow
|
return csvrow
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue