Fix keyword mother import

This commit is contained in:
PCoder 2021-12-01 12:44:41 +05:30
parent 6770a5a200
commit 11e72af6c9

View file

@ -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']