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 = {}
|
||||
for field in fields:
|
||||
value = getattr(obj, field)
|
||||
value = getattr(obj, field, None)
|
||||
csvrow[field] = '' if value is None else six.text_type(value)
|
||||
return csvrow
|
||||
|
||||
|
@ -1537,7 +1537,7 @@ class MasterView(View):
|
|||
"""
|
||||
csvrow = {}
|
||||
for field in fields:
|
||||
value = getattr(row, field)
|
||||
value = getattr(row, field, None)
|
||||
csvrow[field] = '' if value is None else six.text_type(value)
|
||||
return csvrow
|
||||
|
||||
|
|
Loading…
Reference in a new issue