From f8e98a58174ddb24368c511a728e45b5d0890683 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 16 Oct 2017 17:38:42 -0700 Subject: [PATCH] Avoid potential bugs when generating CSV results data for download --- tailbone/views/master.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tailbone/views/master.py b/tailbone/views/master.py index 5f096561..8cc252ce 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -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