summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit36529b321bda673a47b67caf389dbaef6be4edfc (patch)
tree3ec97fc6cd4cde8ebf56c27be763512f2510772e
parentf2e2d4f7c7172cc84c14613ea4049ae54e75d818 (diff)
downloadIshtar-36529b321bda673a47b67caf389dbaef6be4edfc.tar.bz2
Ishtar-36529b321bda673a47b67caf389dbaef6be4edfc.zip
CSV Export: add documentation type to models to exports - fail silently if type is not available (refs #3652)
-rw-r--r--ishtar_common/models.py2
-rw-r--r--ishtar_common/views.py2
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(