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 | 3a6c60d3c225190e90dee4e33b020299a86d4d37 (patch) | |
tree | 342a84fd6a304f2a1d32cd95c55f9cf3c7e847e0 /ishtar_common | |
parent | a269e6a191388738b05adcd1b0e629c2c4ad586c (diff) | |
download | Ishtar-3a6c60d3c225190e90dee4e33b020299a86d4d37.tar.bz2 Ishtar-3a6c60d3c225190e90dee4e33b020299a86d4d37.zip |
Fix CSV export when export column is not well defined
Diffstat (limited to 'ishtar_common')
-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]: |