From 11e72af6c9a06e0c6c94cd526a45ffcac54090b7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 1 Dec 2021 12:44:41 +0530 Subject: [PATCH] Fix keyword mother import --- app/management/commands/import.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/management/commands/import.py b/app/management/commands/import.py index 2449278..5c12d8e 100644 --- a/app/management/commands/import.py +++ b/app/management/commands/import.py @@ -468,6 +468,7 @@ def handle_object_dict(object_dict, model_name, debug=False): try: object_dict['mother'] = Keyword.objects.get(keyword_id=object_dict['mother']) # default Keyword which exists already except Keyword.DoesNotExist as dne: + object_dict['mother'] = Keyword.objects.get(keyword_id=0) print(str(dne)) if model_name == 'Organization' and 'country_id' in object_dict: object_dict['country'] = object_dict['country_id']