diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-22 17:21:55 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:17 +0100 |
commit | f6d6293e5753a2e2acc1b71c3725c74234df2dbc (patch) | |
tree | 38dba177fb81238d53b75c517ae5e81e9052f18e /ishtar_common | |
parent | f4a773f6b3e1122e09bf330bb403a2b9d7d37a43 (diff) | |
download | Ishtar-f6d6293e5753a2e2acc1b71c3725c74234df2dbc.tar.bz2 Ishtar-f6d6293e5753a2e2acc1b71c3725c74234df2dbc.zip |
migrate_to_geo_v4: fix migration when multi_polygon_source_item or point_source_item is NULL
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/management/commands/migrate_to_geo_v4.py | 6 | ||||
-rw-r--r-- | ishtar_common/version.py | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ishtar_common/management/commands/migrate_to_geo_v4.py b/ishtar_common/management/commands/migrate_to_geo_v4.py index 1b2a2dadc..63a074363 100644 --- a/ishtar_common/management/commands/migrate_to_geo_v4.py +++ b/ishtar_common/management/commands/migrate_to_geo_v4.py @@ -174,7 +174,8 @@ def _process_main(obj): ) obj_verbose_names = cls_labels[obj.__class__.__name__] if obj.multi_polygon_source == "P" and obj.multi_polygon \ - and obj.multi_polygon_source_item in obj_verbose_names: + and (obj.multi_polygon_source_item in obj_verbose_names or + obj.multi_polygon_source_item in (None, "")): attrs = { "name": f"{_(model_name.capitalize())}{_(':')} {str(obj)}", "source_content_type": model_content_type, @@ -195,7 +196,8 @@ def _process_main(obj): ] ) if obj.point_source == "P" and obj.point_2d \ - and obj.point_source_item in obj_verbose_names: + and (obj.point_source_item in obj_verbose_names or + obj.point_source_item in (None, "")): if obj.x and obj.y: attrs = { "name": f"{_(model_name.capitalize())}{_(':')} {str(obj)}", diff --git a/ishtar_common/version.py b/ishtar_common/version.py index d7c8dd304..773944beb 100644 --- a/ishtar_common/version.py +++ b/ishtar_common/version.py @@ -1,5 +1,5 @@ -# 4.0.9 -VERSION = (4, 0, 9) +# 4.0.10 +VERSION = (4, 0, 10) def get_version(): |