diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-07-12 12:16:30 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-07-12 12:16:30 +0200 |
commit | c97c0c707787bf6b6dda4ab1859b269baf418363 (patch) | |
tree | 3ec97fc6cd4cde8ebf56c27be763512f2510772e /ishtar_common | |
parent | 7f88c7f77b615aa8f3de93589d4ce313be652e87 (diff) | |
download | Ishtar-c97c0c707787bf6b6dda4ab1859b269baf418363.tar.bz2 Ishtar-c97c0c707787bf6b6dda4ab1859b269baf418363.zip |
CSV Export: add documentation type to models to exports - fail silently if type is not available (refs #3652)
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/models.py | 2 | ||||
-rw-r--r-- | ishtar_common/views.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 639e44af3..5c84447a4 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2220,6 +2220,8 @@ TARGET_MODELS = [ ('archaeological_context_records.models.Unit', _(u"Unit")), ('archaeological_context_records.models.ActivityType', _(u"Activity type")), + ('archaeological_context_records.models.DocumentationType', + _(u"Documentation type")), ('archaeological_finds.models.MaterialType', _(u"Material")), ('archaeological_finds.models.ConservatoryState', _(u"Conservatory state")), diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 0be382866..5786391cc 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1153,7 +1153,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[], for idx, col_name in enumerate(table_cols): val = data[1:][idx + delta].encode( ENCODING, errors='replace') - if "|" in col_name[0]: + if col_name and "|" in col_name[0]: for delta_idx in range(len(col_name[0].split('|')) - 1): delta += 1 val += data[1:][idx + delta].encode( |