diff options
Diffstat (limited to 'ishtar_common/data_importer.py')
-rw-r--r-- | ishtar_common/data_importer.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 95763ae09..c568f1861 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -36,7 +36,7 @@ from django.db.models import Q from django.template.defaultfilters import slugify from django.utils.translation import ugettext_lazy as _ -from ishtar_common.utils import get_all_field_names, update_data +from ishtar_common.utils import debug_line_no, get_all_field_names, update_data NEW_LINE_BREAK = '#####@@@#####' @@ -1015,13 +1015,21 @@ class Importer(object): for idx, key in enumerate(keys): if idx == (len(keys) - 1): # last if concat: - if key not in current_data: - current_data[key] = "" - if not value: - continue - current_data[key] = (current_data[key] + concat_str) \ - if current_data[key] else u"" - current_data[key] += value + if isinstance(value, (list, tuple)): + if key not in current_data: + current_data[key] = [] + if not value: + continue + current_data[key] += value + else: + if key not in current_data: + current_data[key] = "" + if not value: + continue + current_data[key] = ( + current_data[key] + concat_str) \ + if current_data[key] else u"" + current_data[key] += value elif force_value and value: if concat_str and key in current_data \ and current_data[key]: |