diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-11-04 18:25:14 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-11-04 18:25:14 +0100 |
commit | e7ffc153bb3c6cc38667426ba9b01b9dfdbae263 (patch) | |
tree | b44afa71b2a3e6da6ae9a91bdb6db0d86b1c921f | |
parent | 98d8c6c9be5ad5d8bc979a9acdd3bc872e12cedb (diff) | |
download | Ishtar-e7ffc153bb3c6cc38667426ba9b01b9dfdbae263.tar.bz2 Ishtar-e7ffc153bb3c6cc38667426ba9b01b9dfdbae263.zip |
Imports: fix post process when returned item is not a list
-rw-r--r-- | CHANGES.md | 9 | ||||
-rw-r--r-- | ishtar_common/data_importer.py | 3 | ||||
-rw-r--r-- | ishtar_common/version.py | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/CHANGES.md b/CHANGES.md index f31ef9409..dfc3caaa6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,18 @@ --- title: Ishtar changelog -date: 2022-10-23 +date: 2022-11-04 --- Ishtar changelog ================ +v3.2.10 - 2022-11-04 +-------------------- + +### Bug fix ### +- Imports: fix post process when returned item is not a list + + v3.2.9 - 2022-10-23 ------------------- diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 19d53b72a..633d4cfea 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -17,6 +17,7 @@ # See the file COPYING for details. +from collections.abc import Iterable import copy import datetime import os @@ -1039,6 +1040,8 @@ class Importer(object): try: returned = getattr(item, func)(context, value) if returned: + if not isinstance(returned, Iterable): + returned = [returned] for rel in returned: self._add_to_post_save(rel.__class__, rel.pk, idx_line) except ImporterError as msg: diff --git a/ishtar_common/version.py b/ishtar_common/version.py index 021671cc6..0facc66e3 100644 --- a/ishtar_common/version.py +++ b/ishtar_common/version.py @@ -1,5 +1,5 @@ -# 3.2.9 -VERSION = (3, 2, 9) +# 3.2.10 +VERSION = (3, 2, 10) def get_version(): |