diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-03-02 00:18:36 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-03-02 00:18:36 +0100 |
commit | 75b516c460c727273f2556fd76b380b742432424 (patch) | |
tree | 342a84fd6a304f2a1d32cd95c55f9cf3c7e847e0 | |
parent | 3fff5e16d4f24d7ff28126be98531393bae9e49f (diff) | |
download | Ishtar-75b516c460c727273f2556fd76b380b742432424.tar.bz2 Ishtar-75b516c460c727273f2556fd76b380b742432424.zip |
Fix CSV export when export column is not well defined
-rw-r--r-- | ishtar_common/models_imports.py | 1 | ||||
-rw-r--r-- | ishtar_common/views.py | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index 0a6a52c73..f94bc6dc0 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -604,6 +604,7 @@ class TargetKey(models.Model): TARGET_MODELS = [ ('OrganizationType', _(u"Organization type")), + ('ishtar_common.models.OrganizationType', _(u"Organization type")), ('TitleType', _(u"Title")), ('SourceType', _(u"Source type")), ('AuthorType', _(u"Author type")), diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 2ea10d0e8..e1ae52956 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1258,6 +1258,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[], row, delta = [], 0 # regroup cols with join "|" for idx, col_name in enumerate(table_cols): + if len(data[1:]) <= idx + delta: + break val = data[1:][idx + delta].encode( ENCODING, errors='replace') if col_name and "|" in col_name[0]: |